Thread: sequencial sort
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default sequencial sort

You posted sample code that is sorting on column C, but your first post said
your data was in column B. You also appear to want to sort the rows out to
column t, so the information I gave you would be put in column U and you
would sort on U as your primary key, and C as your secondary key.

=countif($C$1:C1,C1)

Why you are looping is a mystery and could mean the problem is much
different than what you describe or that is isn't necessary (more likely).

The code I have seems to sort 1234 and stops. It then leaves the 4 sorted
cells blocked.


What that means is a mystery.

With a clear statement of the problem and a clear understanding of your data
this could be accomplished in minutes rather than the days you have played
around with it.



--
Regards,
Tom Ogilvy


"Curt" wrote in message
...
The code follows The file with data only is scrambled entries not in
sequence
needs to be a column with 12345678 12345678 This would be a2:a17t column .
Want column to sort 12345678 then repeat again until column is complete
sorted. Sorted column could be up to 100 maybe more. Hope this explains
best
I can.
The code I have seems to sort 1234 and stops. It then leaves the 4 sorted
cells blocked.
Sub tst_1()
Dim t
For t = 2 To Cells(100, 3).End(xlUp).Column Step 8
Range(Cells(t, 3), Cells(t + 3, 3)).Select
Selection.Sort Key1:=Range("C2:c100"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Next
End Sub
Once I get this sort working Them I feel I can go on.
Thanks so much for the help at my age it is a real learning curve but I
enjoy it.
Thanks Again



"Martin Fishlock" wrote:

Curt,

Why don't you send me the excel file with data and details of how you
want
it and I will see if I can do it to
hiss
(delete the .cutthis).
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Curt" wrote:

Did sort with helper did not get needed got 1122334455667788 needed
12345678
and repeat to end of column many entries 1 thru eight scrambled as they
come
in.

"Martin Fishlock" wrote:

Curt

Sorry, didn't pick up your reply.

Did you solve your problem?

A helper column is simply a new column that is used to help to do the
task.

So if your numbers are in column A "insert" a new column next to A
and if you have headings in row 1 put in the new heading "Helper" and
then
in the new column under the header enter

a=INT((ROW()-1)/8)

copy this down for the entire list

then copy and paste special values the new column

the sort on the new column as 1 and the list as 2 (clicking header
row)


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Curt" wrote:

Not familar with helper column don't catch on to sort helper then
other. Do
you know of any documention about this so I may study. Will try
excel help
maybe be there.
Thank You so much

"Martin Fishlock" wrote:

Use a helper column with a formula like

=INT((ROW()-1)/8)

you may need to adjust the -1 depending on the start row, I
started in row 1.

then copy it down and then copy space special values.

then sort on the helper column and then the column with 12345678.


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Curt" wrote:

is it possible to sort a column with many entries 1 thru 8 in a
12345678
order then repeat again,and again until complete column is
sorted? All groups
being 12345678.