Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey All
I'm learning VBA in Excel and am confused about variable scope. I have declared a variable at the top of the thisWorkBook module as follows: Option Explicit Public mAb when I add mAb to the Watchlist, and select Context = thisWorkbook, I can see the contents. When I add another copy to the Watchlist, selecting Context=(All Modules) it shows up as "Expression not defined". I am guessing that this is the reason I am unable to store values in mAb from inside Subs in my UserForms - they don't know about the variable. Is there some setting that would cause this behavior? How can I share a variable between my thisWorkBook and a UserForm? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Scope of Variables | Excel Discussion (Misc queries) | |||
Scope of variables | Excel Programming | |||
Public Variables | Excel Programming | |||
Scope of a public variable | Excel Programming | |||
Scope of Public Variable | Excel Programming |