Help!!

bgcogen

Registered User.
Local time
Today, 08:01
Joined
Apr 19, 2002
Messages
61
Hi ya,
Basically, I have a variable that I want to use in two different Subs. I declare them as being public i.e. Public month As Integer

...but I get an error saying; "Invalid attribute in Sub or function"

What can I do???

D
 
Hi,

Month is already used as a function in VBA, so you will have to call your variable some other meaningful name.

HTH

Rich
 
Furthermore, the variable has to be declared outside of a sub or function.

If the two subroutines are within the same form module add "Public myMonth As Integer" at the top of the form module.

If the two subroutines are not within the same form module, add "Public myMonth As Integer" at the top of a project module.

HTH,

Jeff
 

Users who are viewing this thread

Back
Top Bottom