LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Redim 2D Array Subscript Out Of Range Error

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
Subscript out of range error moglione1 Excel Discussion (Misc queries) 2 August 30th 05 01:21 PM
Subscript Out of Range error in Array... Kevin Lyons Excel Programming 3 February 4th 04 06:17 PM
Subscript out of range error Tom Ogilvy Excel Programming 0 December 10th 03 12:48 AM
Help on subscript out of range error (VB6/VBA) farmer[_2_] Excel Programming 2 November 2nd 03 04:19 PM


All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"