I have a series of subroutines (Sub1, Sub2, Sub3, etc). I want to call a subset of these subroutines based on user defined values. For example, subs 7 through 13.
I thought of using a loop based on the number in the name of subroutine, but it does not seem to work in VBA. Does anyone have suggestions?
Example Code:
Sub test()
Dim i As Integer
Dim Start As Integer
Dim End As Integer
Start = CEM_Exec.Range("User_Start")
End = CEM_Exec.Range("User_End")
For i = Start To End
Call Sub"i"
Next i
End Sub
Sub1,Sub2andSub23don't mean anything, other than "gosh I don't want to be maintaining that code".CallByName. Otherwise if your code is in a standard code module,Application.Runwill do.