Create dynamic variable names?
If you want to reference items/values via "names" created at runtime then
try using a Dictionary object.
Creating variable names at run-time (even when it's possible) is usually not
the best approach to a problem.
Tim.
"J Kruger" wrote in message
m...
Hi,
I have been looking everywhere on how to create dynamic variables in
excel.
I want the same result as what the eval() function in JavaScript gives.
ie.
a1 = new Array(10);
a1[0] = "hello";
alert(eval("a" + 1)[0]);
or
for(i = 0; i <=10; i++){
eval("a"+i) = i;}
Any help would be appreciated.
|