View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
William Benson[_2_] William Benson[_2_] is offline
external usenet poster
 
Posts: 230
Default Concatenating 2 Character to form name Variable

It will not work. Variable Names are dimensioned and there is nothing in VBA
which can evaluate to a variable name.

You might better use an array


Dim A(1 to 3)

For N = 1 to 3
A(N) = cells.(1,N).value
Next N


"mozart" wrote in
message ...

I am trying to find a way and if possible to concatenate 2 characters so
that they end up being a variable name

For example I want to do something like this.


Sub Test()

Dim A1 as Range, A2 as Range, A3 as range

For N=1 to N

A&N=cells.(1,N).value

Next N

End Sub


Is there a way?

Thanks
Mozart


--
mozart
------------------------------------------------------------------------
mozart's Profile:
http://www.excelforum.com/member.php...o&userid=13314
View this thread: http://www.excelforum.com/showthread...hreadid=399345