D
dhstein
How can I define a global variable that is accessible to any subroutine in
any module of the workbook? Thanks for any help on this.
any module of the workbook? Thanks for any help on this.
Chip Pearson said:Above and outside of any procedure in the module, declare the variable
with a declaration like:
Public MyVar As Long
This variable will be accessible from any procedure in any module of
the VBA project (and to other VBA projects that reference this one)
and will retain its value after a procedure terminates.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)