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

If you want to sort ROWS in groups of 8, why sort on groups of 4 as you are
doing now. Adjust your code like this:

Sub tst_1()
Dim t
For t = 2 To Cells(100, 3).End(xlUp).Row Step 8
Range(Cells(t, 3), Cells(t + 7, 3)).Select
Selection.EntireRow.Sort Key1:=Cells(t,3),_
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Next
End Sub

Using my previous recommendation fit to your data, you could do it with one
sort, no loop, actually no code required.



--
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.