Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
???The code below (after commenting out !! NO ERROR HERE!! so that it
will compile) executes an endless loop with ActiveCell = "T"; that's to be expected since nothing changes the active cell after any loop. Once the OP has code that works (i.e., avoids the endless loop), if the functions in the freely downloadable file at http://home.pacbell.net/beban are available to the workbook, then in that working code the Redim Preserve line can be replaced with ResizeArray varChargeArray, k, 2 Alan Beban Tom Ogilvy wrote: Keith gives good advice. You can alter you thinking and transpose the array, then you are redimming the last dimension Dim varChargeArray() Dim k as Long k = 1 ReDim varChargeArray(1 to 2,1 To k) While Not IsEmpty(ActiveCell) If ActiveCell.Value = "T" Then ReDim Preserve varChargeArray(1 to 2,1 To k) !! NO ERROR HERE!! varChargeArray(1, k) = ActiveCell.Offset(0, 2).Formula varChargeArray(1, k) = ActiveCell.Offset(0, 28).Formula k = k + 1 End If Wend |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Discussion (Misc queries) | |||
Subscript Out of Range error in Array... | Excel Programming | |||
Subscript out of range error | Excel Programming | |||
Help on subscript out of range error (VB6/VBA) | Excel Programming |