CareerChange
03-31-2011, 06:20 PM
I'm probably overlooking the obvious, but can this be done?
I want to avoid coding conditional logic such as a "Select Case" or "If" statement by dynamically creating a procedure name from a derived string.
Here's a code snippet...
Sub TestStub
Dim sProcedure as String, sQtr as String
sQtr = "1Q" ' this variable would normally be set somewhere else
sProcedure = "FindUnassigned " & sType & "Sales"
Call sProcedure
End Sub
Sub FindUnassigned1QSales
'....
End Sub
Sub FindUnassigned2QSales
'....
End Sub
I want to avoid coding conditional logic such as a "Select Case" or "If" statement by dynamically creating a procedure name from a derived string.
Here's a code snippet...
Sub TestStub
Dim sProcedure as String, sQtr as String
sQtr = "1Q" ' this variable would normally be set somewhere else
sProcedure = "FindUnassigned " & sType & "Sales"
Call sProcedure
End Sub
Sub FindUnassigned1QSales
'....
End Sub
Sub FindUnassigned2QSales
'....
End Sub