Sharing Variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I give a variable a value in a macro inside a worksheet. I want it to be
available later in other macros in other worksheets and in "ThisWorkbook".
How do I do this?

Thanks.
 
If you want the variable to be accessable in the same module, you can define
the variable (use dim statement) outside of all functions/procedures and put
it at the top of coding.

If you want the variable to be accessable in other modules, use public
statement.


--
Best regards,
---
Yongjun CHEN
==================================
- - - - www.XLDataSoft.com - - - -
Free Excel/VBA Tool & Training Material
==================================
 
Back
Top