Bonediggler1
Technical User
Hello-
Is it possible to use a variable to refer to a sub procedure? VBA only seems to recognize the literal name when compiling the code. E.G:
Dim strSubName as String
Dim strCustName as String 'Customer name
strSubName = strCustName & "_Process" 'Literal sub name
Select Case strCustName
...
Case "A"
Call strSubName
...
End Select
In this case strSubName would translate into "A_Process", which is the literal name of another sub procedure. However when compiling, the error "Expected sub, function, or property" pops up.
Thank you!
Is it possible to use a variable to refer to a sub procedure? VBA only seems to recognize the literal name when compiling the code. E.G:
Dim strSubName as String
Dim strCustName as String 'Customer name
strSubName = strCustName & "_Process" 'Literal sub name
Select Case strCustName
...
Case "A"
Call strSubName
...
End Select
In this case strSubName would translate into "A_Process", which is the literal name of another sub procedure. However when compiling, the error "Expected sub, function, or property" pops up.
Thank you!