hellsreach
New Member
- Joined
- Dec 22, 2015
- Messages
- 19
I am trying to can one of several macros by variable name and not sure how.
Sub myMacro()
Dim myArray(2) as Variant
myArray(0) = "A"
myArray(1) = "B"
myArray(2) = "C"
For I = 0 to 2
Call myArray(I) ' -- clearly, this wont work!!!
Next I
End Sub
Private Sub A()
...
End Sub
Private Sub B()
...
End Sub
Private Sub C()
...
End Sub
Sub myMacro()
Dim myArray(2) as Variant
myArray(0) = "A"
myArray(1) = "B"
myArray(2) = "C"
For I = 0 to 2
Call myArray(I) ' -- clearly, this wont work!!!
Next I
End Sub
Private Sub A()
...
End Sub
Private Sub B()
...
End Sub
Private Sub C()
...
End Sub