View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default Using Loop to create Array


Can someone identify the problem in the following code which seeks to
create an array using the product of a loop.

Sub CreateArray()

For i = 1 to 100 Step 0.5
k = k & """" & "Level" & """" & i
Next
'create the array
v =Array(Left(k,Len(k)-1))

For j = LBound(v) to UBound(v)
Debug.print v(j)
Next

Problem is v(j) returns blank although if the ouput of debug.print
Left(k,Len(k)-1) is slotted into v =Array(Left(k,Len(k)-1)), the code
wprks fine. What am I missing?

TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=379247