Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Ping Alan Beban: ResizeArray

I've been resizing arrays using Alan's excellent ResizeArray routine,
but suddently noticed that when I sent 2D arrays in, the second
dimension of the array was not getting updated. Then I saw that once
the first dimension reached like 26K (due to a bug elsewhere in my
code), it didn't get any bigger either.

Assuming the array is not of type "object," you invoke this bit of
code:

For i = LBound(myArray, 1) To _
Application.Min(UBound(myArray, 1), newDim(1))
For j = LBound(myArray, 2) To _
Application.Min(UBound(myArray, 2), newDim(2))
arr1(i, j) = myArray(i, j)
Next
Next

Probably this should be obvious, but why are you taking the minimum of
the old array size and the new? I'm not sure now how the first
dimension of a 2D array ever gets bigger because of the presence of
that Application.Min test.

Thanks in advance for any help.

Reply
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
Has anyone used arrayfunctions from Alan Beban? SteveT Excel Worksheet Functions 3 February 26th 07 07:52 AM
VlookupS-Alan Beban Deeds Excel Worksheet Functions 4 December 20th 05 12:03 AM
ResizeArray for Alan Question Marston Excel Programming 1 August 25th 04 07:29 PM
Problem with Alan Beban's ResizeArray RB Smissaert Excel Programming 3 January 29th 04 11:46 PM


All times are GMT +1. The time now is 12:20 AM.

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

About Us

"It's about Microsoft Excel"