public but private variables

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
Declare the variables as Private. E.g.,

Private MyVar As Long


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

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

Back
Top