View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Static variables

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

--
Regards,
Tom Ogilvy

"lynnnow " wrote in message
...
Hi,

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

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

Txs.


---
Message posted from http://www.ExcelForum.com/