Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variables in Excel modules

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
US
Hi,
This is a very basic question. In Excel, the variables defined in modules are global variables, right?

Thanks!
 
Sjh,

It depends on where they are defined, if you create a module and in the declarations section declare;

Code:
Public intVariable As Integer

This would be global and available to the entire project.

Code:
Private intVariable As Integer

This would be available only to Subs/Functions within that module.

Ultimately, you need to ask yourself how visible the variable needs to be and assign it either Public or Private.

Hope this helps.

Leigh Moore
LJM Analysis Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top