View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Help with data sorting - macro?

Is the file a text file.

I would suggest using Line Input to read in a line at the time

have an array

sorted1(1 to 1, 1 to 250)
sorted2(1 to 1, 1 to 250)
sorted3(1 to 1, 1 to 250)
sorted4(1 to 1, 1 to 250)

loop throught the Line Input results and parse out your values.

use value mod 250 to get the idex into the array
use int(value/250)+1 to get the array to use (case statement)

then just assign the values to their appropriate index,

then assign each array to the appropriate row on 4 worksheets
clear the arrays,
get the next line.

--
Regards,
Tom Ogilvy

rine9558 wrote in message
...

The data is being imported from another program. I can break it into
chunks if I can only sort 256 columns at a time. I can also condense
the rows down so all the blank cells are at the end of the row.
However, I'm still left with a row of integers that I would like to be
sorted into columns. The range of integers is large (each row might
contain 100 numbers between 1 and 1000) and there is no row with all
the numbers. I suppose I could search all the cells for the MIN and
MAX, and then look for each integer in between and save that as an
array which becomes the column designations (header?), then sort the
numbers in each row so that they are aligned under the correct column
header leaving blank cells where a row doesn't contain a
number...??????

Any help is appreciated.
CHUCK


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/