Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Static variables
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 -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Static variables
lynnnow,
You need to understand the concept of "Scope". Check Help. NickHK "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/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Static variables
If all fails, you can store such variables in a worksheet. Leave it as "very
hidden" and pass the variables to the cells. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Static y-axis | Charts and Charting in Excel | |||
Static Row | New Users to Excel | |||
Static Cenll | Excel Worksheet Functions | |||
Static variables | Excel Programming |