Help!! (1 Viewer)

bgcogen

Registered User.
Local time
Today, 15:28
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
 

Howlsta

Vampire Slayer
Local time
Today, 15:28
Joined
Jul 18, 2001
Messages
180
Hi,

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

HTH

Rich
 

rockman

Senior Member
Local time
Today, 07:28
Joined
May 29, 2002
Messages
190
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

Top Bottom