Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible in VBA to determine a variable name from a string? For
example - - - - - - - Dim VariableName as String Dim FavoriteNumber as Integer FavoriteNumber = 55 VariableName = "FavoriteNumber" msgbox {*} - - - - - - * indicating an expression that will return the value of the FavoriteNumber variable, using the value of VariableName ("FavoriteColor") to evaluate the FavoriteColor variable, and return the value of 55. I know the example seems overly complicated (why not just use the FavoriteNumber directly in the code?) I have a class module with 65 variables, and I would like to place a reference to them all in an Array, so that I can loop through them all and assign values, yet I would like the values to still be updated if any of the variables are updated outside of the array. In other words, I would like an object or expression that references a variable. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to evaluate string? | Excel Programming | |||
Evaluate and execute a string | Excel Programming | |||
Evaluate string as a formula | Excel Worksheet Functions | |||
Evaluate using a variable - Help please | Excel Programming | |||
how to evaluate the content of a string as if it was a formula | Excel Discussion (Misc queries) |