View Single Post
  #1 (permalink)  
Old November 10th, 2006, 11:28 AM
TheBFJ TheBFJ is offline
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic variable/object names

Hi,

I'm slowly getting my head round VBA, but one feature I make use of frequently in other languages is dynamically naming a variable or object. I understand that some of this functionality can be reproduced with named ranges but could someone please give me a straight answer to this question:

In VBA is there an equivelent function to javaScript's eval() function or Object access operator [], which will allow me to create a variable at runtime like this:

Dim someString & someNumber As Integer

Js equivalent var eval(someString + someNumber) //(ish I'm a bit out of practice)

VBA claims to be an OO environment so it seems this functionality must exist. This is more for my own understanding of the language rather than a practical problem so please no "just use a named range" answers.

Many thanks
Reply With Quote