Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() maybe you're new to vba and it looks to me your're trying to create an array the same way you would in a worksheet formula. although you could do it using split (if you have xl2000+) (see post from Nick Hebb) in VBA functions cant work with arrays like this: Left(array,3) VBA functions are meant for single values, not for arrays. in some case you can use application.worksheetfunction or worksheet.evaluate("=left(a1:a10,3)") to process arrays and get an array as the result. but those are the exceptions not the rule. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam davidm wrote : 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop through array of worksheets | Excel Programming | |||
How do I create a For loop within a For loop? | Excel Programming | |||
Help with Loop / Array / Ranges | Excel Programming | |||
Assign Results from If...Then and Loop to an Array (VBA) | Excel Programming | |||
Help -- Loop or Array? How to identify? | Excel Programming |