public variable

  • Thread starter Thread starter marwan hefnawy
  • Start date Start date
M

marwan hefnawy

I have declared a Public variable in "ThisWorkbook" module level.
Then I gave it a value in the event procedure Workbook_Open()
the problem is that when I use this variable in other modules, it is not
recognized.
anyone knows what is the problem?
I want to assign a value to a variable once (at workbook opening or at
worksheet opening) then I want to use this variable value in all modules,
How to make it/
Thanks in advance.
 
Hello Marwan
Declare your variable in a standard module not in Thisworkbook which is
private.
Assign your value in the Workbook_Open event
Regards
Pascal
 
Back
Top