Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable
If i have a variable that I want to set and use from TheWorkbook, a number of
difference worksheets, a module, and a class module, which General Declarative section do I put it in, and do I reference it as a Public Variable or something else. Thanks Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable
Check out.
http://www.ozgrid.com/VBA/variable-scope-lifetime.htm -- Jacob (MVP - Excel) "sarndt" wrote: If i have a variable that I want to set and use from TheWorkbook, a number of difference worksheets, a module, and a class module, which General Declarative section do I put it in, and do I reference it as a Public Variable or something else. Thanks Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable
I would insert a new module (Insert|Module type) and use:
Public MyVar as Long 'or double or ... sarndt wrote: If i have a variable that I want to set and use from TheWorkbook, a number of difference worksheets, a module, and a class module, which General Declarative section do I put it in, and do I reference it as a Public Variable or something else. Thanks Steve -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable
Dave...
Why would you put it in a new module instead of the existing module Module1? "Dave Peterson" wrote: I would insert a new module (Insert|Module type) and use: Public MyVar as Long 'or double or ... sarndt wrote: If i have a variable that I want to set and use from TheWorkbook, a number of difference worksheets, a module, and a class module, which General Declarative section do I put it in, and do I reference it as a Public Variable or something else. Thanks Steve -- Dave Peterson . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable
It's not necessary. I just wanted to make sure that you used a General module
and that was the best way I knew to describe what I wanted. But I will (usually, but not always), put all my public variables in a dedicated module -- maybe some initialization routines, too. But that's just for organizational purposes. sarndt wrote: Dave... Why would you put it in a new module instead of the existing module Module1? "Dave Peterson" wrote: I would insert a new module (Insert|Module type) and use: Public MyVar as Long 'or double or ... sarndt wrote: If i have a variable that I want to set and use from TheWorkbook, a number of difference worksheets, a module, and a class module, which General Declarative section do I put it in, and do I reference it as a Public Variable or something else. Thanks Steve -- Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assigning a Variable to an Expression that Includes a Variable andVBA Property | Excel Programming | |||
Nothing Keyword Destories Objects rather than just resetting the variable to an empty variable | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |