How to declare global variable in Excel VBA?

  • Thread starter Thread starter Sing
  • Start date Start date
S

Sing

Dear Excel Gurus,

This may sound like a basic question, but I only know C and am new to Excel
VBA

I wish to define a global variable that is accessible to all worksheets. Can
someone advise?

Thanks.
 
In a standard/regular module - not a Class module - at the top of the module...

Public Const LNG_LENGTH As Long = 123
-or-
Public lngLength as Long
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Sing"
wrote in message
Dear Excel Gurus,
This may sound like a basic question, but I only know C and am new to Excel
VBA
I wish to define a global variable that is accessible to all worksheets. Can
someone advise?
Thanks.
 
Back
Top