Static variables

L

lynnnow

Hi,

I've got a startup Sub which has a msgbox with Y/N option. Thereafte
it shows the Application.GetOpenFilename option and the file names ar
stored to variables. Then I've got a userform that has comboboxes i
it and after this private Sub is over, I need the variables that
created in the startup Sub. These variables show Empty in the Watc
section or it shows an Out of Subscript error.

How can I keep these variables static so that I can use it later. I'v
tried using Static, but it does not help

Txs
 
T

Tom Ogilvy

Use a variable declared as Public at the top of a general module (and above
any subs or functions).
 
C

cmart02

If all fails, you can store such variables in a worksheet. Leave it as "very
hidden" and pass the variables to the cells.
 
Top