Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want to set a variable in a Workbook open event and then refer to it in
another module. I tried to set a Public variable in the Workbook code but then the module doesn't recognize it. Any help is appreciated. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put the variable in a General/standard/normal module.
Public MyVar as Variant '???? Then in the ThisWorkbook module: Option Explicit sub workbook_open() myvar = "what ever you want" end sub dhstein wrote: I want to set a variable in a Workbook open event and then refer to it in another module. I tried to set a Public variable in the Workbook code but then the module doesn't recognize it. Any help is appreciated. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Dave.
"Dave Peterson" wrote: Put the variable in a General/standard/normal module. Public MyVar as Variant '???? Then in the ThisWorkbook module: Option Explicit sub workbook_open() myvar = "what ever you want" end sub dhstein wrote: I want to set a variable in a Workbook open event and then refer to it in another module. I tried to set a Public variable in the Workbook code but then the module doesn't recognize it. Any help is appreciated. -- Dave Peterson . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Global Variable | Excel Discussion (Misc queries) | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
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 | |||
I Need VBA Assistance for global variable question | Excel Discussion (Misc queries) | |||
Global Variable -- Excel / VBA | Excel Discussion (Misc queries) |