Global variable

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Is there any way to have the same variable available to a
worksheet function (e.g. button_click) and a sub
procedure in a code module. I need to have the same
variable (an index in a for loop) available to both. Any
thoughts?
 
Declare the variable publicly (preferrably at the top of a ) module, like...

Public gvVariable as Variant

or

Global gvVariable as Variant
 
Back
Top