Google
Search WWW Search My Site!

VBA - Using Static variables
Ivan F Moala
Can Do
Visits here
Goto Guest book sign in page [Home]
Greatest place to be
Thanks for visiting my site lucky visitor:
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page

Static variables:

From Microsoft help:
Used at procedure level to declare variables and allocate storage space.
Variables declared with the Static statement retain their values as long as
the code is running.

So what can we use the static variable for?
Here is a routine that monitors a given range of values and adds the last value entered with the last cell value eg. Range("I4:I186") is the monitored range in this example, entering any number in these cells will  automatically update the current cell value + the entered value.
See below for commented code

Download file here.............
This page was last updated on: 21 June 2002