Re: Changing the name of a variable using code
- From: pltaylor3@xxxxxxxxx
- Date: 10 Jan 2007 09:15:39 -0800
They are in two single arrays from a database recordset. I'm up for
any suggestions.
George Nicholson wrote:
I don't think you can make X = 23 but you could create a function to which
you would pass your variable name & get the variable value back so that:
GetFromArray(X) = 23.
(The function would have to loop through the entire array looking for X, get
the corresponding value & exiting the loop once found)
This would allow you to access the array elements much like the elements of
a collection, which raises the question (in my mind at least) if you
wouldn't be better off simply putting your variables into a collection in
the first place. It may be a coin toss depending on what you are doing.
HTH
<pltaylor3@xxxxxxxxx> wrote in message
news:1168437599.875075.21790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have an array that is two wide and an undefined length. The first
column is a name of a variable and the second column is the value of
that variable. How can i define all the items as there name = value?
i.e array(1,0) = X array(1,1) = 23 make it so that X = 23. This is
probably really simple and i would appreciate any help.
thanks
Perry
.
- References:
- Changing the name of a variable using code
- From: pltaylor3
- Re: Changing the name of a variable using code
- From: George Nicholson
- Changing the name of a variable using code
- Prev by Date: Re: auto-resizing UserForm window
- Next by Date: Re: Why does my file say it has macros, but I can't find them?
- Previous by thread: Re: Changing the name of a variable using code
- Next by thread: Re: Changing the name of a variable using code
- Index(es):
Relevant Pages
|