Public Variable in ThisWorkbook

  • Thread starter Thread starter DRKML
  • Start date Start date
D

DRKML

I want to declare some public variables as soon as I open the workbook. Can
I do that in "ThisWorkbook" or do I need to put it in a module and have
"ThisWorkbook" Open event call a routine to set the public variables?
 
If the variables are going to be used in procedures outside the
ThisWorkbook module, you should declare them in the declarations
section of a regular code module, and initialize them in the Open
event procedure.


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

Chip Pearson said:
If the variables are going to be used in procedures outside the
ThisWorkbook module, you should declare them in the declarations
section of a regular code module, and initialize them in the Open
event procedure.


--
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