|
-
Feb 16th, 2006, 07:34 PM
#1
Thread Starter
Junior Member
Can't declare Public Constant in a macro in Excel?
Ok...I have a macro I wrote which calls on other subs. I wanted to declare some global constants so I could change the variable easily if I had to change it later on. So this is what I have:
Sub MyMacro()
Public Const MATRIX As String = "Tab 1"
Public Const MATRIX2 As String = "Tab 2"
Call OtherSub
Call OtherSub2
End Sub
So basically I want to pass the constants MATRIX and MATRIX2 to the other subs. But everytime I try to run the debugger, I get the error:
Compile error:
Invalid attribute in Sub or Function
I am using Microsoft Excel 2003 SP1 and VB 6.3 Version 9972. Any ideas or tips would be greatly appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|