Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to initialize a few arrays (info taken from a worksheet) at the beginning of a session and have them survive the entire session even though many different macros will run and end during the session. Currently, I reload the arrays each time a macro is run. But it would be neater if I would not have to do this. I have tried public, but the array values do not seem to survive the end of a macro. My public is declared in a module, and initialized when a "driver" macro begins to run. The driver is fired each time the user right clicks on a sheet. The driver macro calls many subs. The variables survive until the end but do not retain their value when a sheet is right clicked a second time. The variables have to be initialized again. Is what I am asking possible to do? -- eugene |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public variables are public to the procedures or functions within that
module. If you wanted a variable that retained its value outside the module then you would need to declare a global variable: Global myarray(0 to 50) as string |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks
-- eugene "Brian Taylor" wrote: Public variables are public to the procedures or functions within that module. If you wanted a variable that retained its value outside the module then you would need to declare a global variable: Global myarray(0 to 50) as string |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Brian, Public variable is a Global variable
Look in Excel Help!!! "Brian Taylor" wrote in message oups.com... Public variables are public to the procedures or functions within that module. If you wanted a variable that retained its value outside the module then you would need to declare a global variable: Global myarray(0 to 50) as string |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Rick.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ballmer says Microsoft can survive crisis | New Users to Excel | |||
Ballmer says Microsoft can survive crisis | New Users to Excel | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Start a new session when a session is already opend | Excel Programming | |||
NEED HELP! Macro didn't survive XP! | Excel Programming |