Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have written some code to extract data from a source into an array this code worked fine until I decided I needed 2 pieces of info fo each piece of data. This caused a subscript out of range error in th Redim Preserve statement line. k = 1 ReDim varChargeArray(1 To k, 1 To 2) While Not IsEmpty(ActiveCell) If ActiveCell.Value = "T" Then ReDim Preserve varChargeArray(1 To k, 1 To 2) !!ERRO HERE!! varChargeArray(k, 1) = ActiveCell.Offset(0, 2).Formula varChargeArray(k, 2) = ActiveCell.Offset(0, 28).Formula k = k + 1 End If Wend When the array was just one dimension i had no problems. Can anybody help me? Many thanks, To -- Message posted from http://www.ExcelForum.com |
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 |