View Single Post
 
Old 12-02-2013, 10:09 PM
omahadivision omahadivision is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Oct 2012
Posts: 28
omahadivision is on a distinguished road
Default Can a function or sub be called using a variable name?

Hello,

I have a variable that can be about twenty values. For each different value, I would want to call a different sub or function. I don't want to have to have a ton of If or case statements. Is it possible to do something like

dim VariableName as string

(other code figures out what VariableName is)

then the function

Call VariableName

?

I have tried brackets, putting .value after variable name, quotes, and other tactics. I always am told that the sub or function is not defined. The sub or function VariableName would always exist, but I couldn't call it that way.
Reply With Quote