I don't think it's double declared...I think it's something else. Check it out. So I initially had two modules. Module 1 had the macro I wanted to run. So it basically had:
MODULE 1:
VB Code:
Public Const MATRIX As String = "Tab 1"
Public Const MATRIX2 As String = "Tab 2"
Sub MyMacro()
Sheets(MATRIX).Select
Call OtherSub
Call OtherSub2
End Sub
Module 2 had all of my other subs...
MODULE 2:
VB Code:
Sub OtherSub()
Sheets(MATRIX2).Select
End Sub
Running from top-to-bottom, when Module 1 would call Sub OtherSub() and the pointer got to Module 2 Sub OtherSub(), I would right away get the error:
Compile error:
Ambigous name detected: MATRIX2
So I basically copied all of my code from Module 2 to Module 1 making it look like this:
MODULE 1:
VB Code:
Public Const MATRIX As String = "Tab 1"
Public Const MATRIX2 As String = "Tab 2"
Sub MyMacro()
Sheets(MATRIX).Select
Call OtherSub
Call OtherSub2
End Sub
Sub OtherSub()
Sheets(MATRIX2).Select
End Sub
I then deleted Module 2 and this worked...but it's not really pretty or the best coding practice.
So billhuard suggested to try:
I thought all I would have to do is insert another module, cut the code from Module 1 to the new Module and viola. But now I am getting:
Compile error:
Ambigous name detected: OtherSub
So for some reason my modules aren't associating with each other. And because of this, I think that this might of been my initial problem. Is this a stupid error that can be solved easily...I bet it is...