Re: Changing the name of a variable using code
- From: "George Nicholson" <GeorgeNJunk@xxxxxxxxxxx>
- Date: Wed, 10 Jan 2007 10:29:26 -0600
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
.
- Follow-Ups:
- Re: Changing the name of a variable using code
- From: pltaylor3
- Re: Changing the name of a variable using code
- References:
- Changing the name of a variable using code
- From: pltaylor3
- Changing the name of a variable using code
- Prev by Date: Re: Pasting from Excel to Outlook with VBA code
- Next by Date: Macro Button reference
- Previous by thread: Changing the name of a variable using code
- Next by thread: Re: Changing the name of a variable using code
- Index(es):
Relevant Pages
|