Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15702

[RESOLVED] get value for a variable where the name of the variable is composed dynamically

$
0
0
Sorry for that clunky title.

I need to do this:
Dim strName as String
strName = "Bill"

a = "str"
b = "Name"

x = Eval(a&b) 'this is where I need help

and now x should hold the value "Bill"

I know this can be done because I've done it before.
How do I compose the name of a variable programmatically and retrieve its value?
I know i can pass strName to x directly, but I need to be able to do it dynamically.

I don't think Eval() is what I'm looking for, but I know there is a way to do it. Just can't remember.

Thanks.

Viewing all articles
Browse latest Browse all 15702

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>