public but private variables

G

Guest

how can i make variables public to a particular mobule
(particular project) and still not accessible to other
projects (macros) in the same workbook.

currently i declare variables as Public... as these need
to be used by different procedures in the same macro!

thanks
 
B

Bob Phillips

Declare it as Private, but not within a macro, at the head of the module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
C

Chip Pearson

Declare the variables as Private. E.g.,

Private MyVar As Long


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top