I have the following code. This example is actually from VBA, but the question is a general VB one.
For x=1 to NameCounter
NameRef=”plant” + trim(str(x)) + “name”
set NameRef = Range(Cells(begindatarow,namecol),Cells(enddatarow,namecol))
Next
I need to modify this code so that the range in the Set statement is assigned to the value of the variable
NameRef and not “NameRef” literally.
For example: plant1name=Range(Cells(begindatarow,namecol),Cells(enddatarow,namecol))