is it possible to call a subroutine in VBA using a concatenation of strings? For example
Sub Call_This_2019()
' do something
end sub
Sub From_this()
Call ("Call_This_" + str(2019))
Sub
I haven't had any luck using this approach.
is it possible to call a subroutine in VBA using a concatenation of strings? For example
Sub Call_This_2019()
' do something
end sub
Sub From_this()
Call ("Call_This_" + str(2019))
Sub
I haven't had any luck using this approach.
I googled 'vba calling dynamic subroutine' and I found this at http://www.vbaexpress.com/forum/showthread.php?36844-Solved-Dynamic-Procedure-call
Sub Call_This_2019()
' do something
MsgBox ("Got here")
End Sub
Sub From_this()
Dim theCallee As String
theCallee = "Call_This_" & LTrim(Str(2019)) ' LTrim removes leading blank
'Call theCallee ' Syntax error
'Call Eval(theCallee) ' 2766 no Application object
Application.Run theCallee
End Sub