Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was very helpful. I greatly appreciate the help!
"Jim Thomlinson" wrote: When refering to variables in other module you just need (or at the very least should) reference the module and then the variable name to get the value something like this... Private Sub Worksheet_calculate() msgbox Module1.TheWb 'Or whatever the module name is end sub Additionally in the module where you declare the variable my preference is to use the public key word so that I know that the variable is being accessed from a procedure outside the module Option Base 1 Public TheWb as String 'Note public instead of just dim While this is not strictly necessary I like it as a reminder... -- HTH... Jim Thomlinson "Mike H." wrote: I have a sub: Private Sub Worksheet_calculate(). How can I read a variable from a module that was set at the top of that module: Option Base 1 Dim TheWb As String I want to know what the value of TheWb is while in the calculate sub... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
STATIC VARIABLE NOT AVAILABLE IN ANOTHER MODULE | Excel Discussion (Misc queries) | |||
How to Set a Variable in Another Module? | Excel Programming | |||
Variable in more than one module | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming | |||
Pass a variable from a class module | Excel Programming |