Global variable

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?
 
R

Robert Rosenberg

Declare the variable publicly (preferrably at the top of a ) module, like...

Public gvVariable as Variant

or

Global gvVariable as Variant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top