Sep 29, 2003 #1 sjh Programmer Joined Oct 29, 2001 Messages 263 Location US Hi, This is a very basic question. In Excel, the variables defined in modules are global variables, right? Thanks!
Hi, This is a very basic question. In Excel, the variables defined in modules are global variables, right? Thanks!
Sep 29, 2003 #2 SQLBI IS-IT--Management Joined Jul 25, 2003 Messages 988 Location GB 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 http://www.ljm-analysis.co.uk Upvote 0 Downvote
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 http://www.ljm-analysis.co.uk