public variable

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.
 
P

papou

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top