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.
|