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: 9
Default Deleting blank values from an array

Hi... newbie here. I have a 2D array that has blank values that I would like
to remove. I searched and found this code:

'Where Arr is array containing blanks and Arr2 is dynamic array
ii = 0
For i = LBound(Arr) To UBound(Arr)
If Arr(i) < "" Then
ReDim Preserve Arr2(ii)
Arr2(ii) = Arr(i)
ii = ii + 1
End If
Next

However, I am getting an error 9: subscript out-of-range for the "If Arr(i)
< "" Then" line and I can't figure out why. The only thing I can think of is
that this code is for a 1D array? Any comments? If so, how do I change the
code to remove blanks from a 2D array. Thanks!

Matt
 
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
Not showing blank and non blank items in filter mode for values Bhaskar Polisetty Excel Worksheet Functions 0 June 20th 06 02:04 PM
Deleting all but one blank row RealGomer Excel Discussion (Misc queries) 2 February 16th 06 06:55 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
Deleting blank values from an array Rich J[_2_] Excel Programming 6 June 1st 05 11:28 PM
Deleting element in Array ExcelMonkey[_190_] Excel Programming 3 March 28th 05 02:47 AM


All times are GMT +1. The time now is 08:11 PM.

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"