Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Public Variable in ThisWorkbook

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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Public Variable in ThisWorkbook

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


"DRKML" wrote in message
...
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?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Public Variable in ThisWorkbook

Thank you.

"Chip Pearson" wrote in message
...
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


"DRKML" wrote in message
...
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?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public variable Jack New Users to Excel 4 March 18th 06 09:35 PM
Public variable usage! Tom Ogilvy Excel Programming 0 April 14th 04 03:34 AM
Public Variable Jason Excel Programming 4 April 12th 04 07:06 PM
Use Checkbox Value or Public Variable? Stratuser Excel Programming 2 February 12th 04 02:33 PM
public variable marwan hefnawy Excel Programming 1 September 5th 03 08:54 AM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"