View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Deleting blank values from an array

Rich J wrote:
I have an array that gets populated with dates from various ranges in my
spreadsheet. In the process blank values also get included. Once filled, I
would like to sort the array with the earliest date in H(0) and the blank
ones deleted by redimensioning the array.
I figured out one way to sort but the blank ones are all in the lower
indexes with the sorted dates at the end.
Is there an easy way to delete the empty elements of the array either while
sorting or another routine after the sort ?
I used the sorting routines in this help site

http://support.microsoft.com/?kbid=213818
I tried a filter routine but it created an error
Thanks


If the functions in the freely downloadable file at
http:/home.pacbell.net/beban are available to your workbook

H = SubArray(H, ArrayCountIf(H, 0), UBound(H), 1, 1)

Alan Beban