Public Declerations
Shawn,
From Help:
Variables declared with Dim at the module level are available to all
procedures within the module. At the procedure level, variables are
available only within the procedure.
Variables declared using the Public statement are available to all
procedures in all modules in all applications unless Option Private Module
is in effect; in which case, the variables are public only within the
project in which they reside.
Since you are talking about within a module - you probably want to Dim the
variable at the top of the module.
--
steveB
Remove "AYN" from email to respond
"Shawn" wrote in message
...
I have a VBA Module named MasterFormulas. In it will be several
sub-routines. The first one starts like this:
Option Explicit
Public Sub MRR()
'Begin General Declerations
Dim WSDSD As Worksheet
Set WSDSD = Worksheets("Data SD")
Dim WSRep As Worksheet
Set WSRep = Worksheets("Report")
Dim WSCri As Worksheet
In every sub-routine in the module MasterFormulas, I want Excel to
remember
these declerations. How can I avoid having to re-declare these in every
sub-routine?
--
Thanks
Shawn
|