Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Variable Name
I have a whole slew of variables that are similarly named:
for example abcdMax = 10 efghMax = 20 ijklMax = 30 ... I want to use the "Max" variable in a function based upon a string that is sent to the function The following code will not work, but I think it illustrates what I am trying to do.... Function myFunction(incomingstring as String) fourletters = Left(incomingstring, 4) dynamicvariable = fourletters & "Max" myFunction = Dateadd("m", dynamicvariable, "00:00") End Function In this code "dynamicvariable" is a string, whereas I want the value of the variable with the same "name" as this string. I understand that I could handle my task with a very long case statement, but I am searching for more brevity. Any and all creative solutions are appreciated! Thanks, Jake |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to replace one dynamic variable with another dynamic variable | Excel Worksheet Functions | |||
Dynamic scenarios - more than 2 variable using data tables in Exc | Excel Discussion (Misc queries) | |||
dynamic summed range based on a variable | Excel Worksheet Functions | |||
Refreshing a dynamic range variable | Excel Programming | |||
Create dynamic variable names? | Excel Programming |