Thread: public variable
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_7_] papou[_7_] is offline
external usenet poster
 
Posts: 41
Default public variable

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

"marwan hefnawy" a écrit dans le message de
...
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.