I've got a pickle I can't seem to find a solution for.
Let's say I have the following code in VBA, which basically, whatever is given for the function Example as a string argument, calls the variable with the same name as the string argument and returns the value of the variable that's been called (if my explanation made any sense):
Private EnterMenu, ExitMenu as String
Function Example(name)
Select Case name
Case "EnterMenu"
Example = EnterMenu
Case "ExitMenu"
Example = ExitMenu
'and so on
End Select
End Function
That's fine and all, but is there a way without writing a case for every single possibility, for example
Function Example(name)
Example=Value(name)
End Function
So that it just grabs the value of the string "name", gets the variable with the same name and returns the value of that variable?