#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 469
Default sorting

am only useing top 50 rows for testing purpose will add the count and reply
as to performace

"Dave Peterson" wrote:

This line would only sort the first 100 rows (maximum 100 rows).

For t = 2 To Cells(100, 3).End(xlUp).Row Step 4

Maybe

For t = 2 To Cells(rows.count, 3).End(xlUp).Row Step 4



Curt wrote:

i did a sort with excel it sorted as usual 1,s 2s, etc tried macro again it
would not resort to 1234

"Dave Peterson" wrote:

It looks like it should work if you re-run it.

How do you know it's not running a second time--maybe the data is already sorted
correctly??????

Curt wrote:

removed data option ran and it worked first time will not run again? No other
changes do not understand not running again have tried many times no responce
Thanks

"Dave Peterson" wrote:

DataOption# was added in xl2002.

If you don't use xl2002+, then delete that parm and its value:

Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom



Curt wrote:

Get xlSortNormal as not declared varaible How do I declare this varable?

"excelent" wrote:

some like this:
sort data in C2:C100 in step of 4 cells

Sub tst()
Dim t
For t = 2 To Cells(100, 3).End(xlUp).Row Step 4
Range(Cells(t, 3), Cells(t + 3, 3)).Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Next
End Sub


"Curt" skrev:

is there a way to sort by cells in a column also can you repeat the search
after first group are reached. column has many groups of numbers want to
group by 1 to 4 repeated. have not been able to get it to sort allways puts
all 1s 2s together. Want a 1234 group.
Anyone? I'm beat
thanks



--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default sorting

I don't have any more guesses.

Curt wrote:

am only useing top 50 rows for testing purpose will add the count and reply
as to performace

"Dave Peterson" wrote:

This line would only sort the first 100 rows (maximum 100 rows).

For t = 2 To Cells(100, 3).End(xlUp).Row Step 4

Maybe

For t = 2 To Cells(rows.count, 3).End(xlUp).Row Step 4



Curt wrote:

i did a sort with excel it sorted as usual 1,s 2s, etc tried macro again it
would not resort to 1234

"Dave Peterson" wrote:

It looks like it should work if you re-run it.

How do you know it's not running a second time--maybe the data is already sorted
correctly??????

Curt wrote:

removed data option ran and it worked first time will not run again? No other
changes do not understand not running again have tried many times no responce
Thanks

"Dave Peterson" wrote:

DataOption# was added in xl2002.

If you don't use xl2002+, then delete that parm and its value:

Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom



Curt wrote:

Get xlSortNormal as not declared varaible How do I declare this varable?

"excelent" wrote:

some like this:
sort data in C2:C100 in step of 4 cells

Sub tst()
Dim t
For t = 2 To Cells(100, 3).End(xlUp).Row Step 4
Range(Cells(t, 3), Cells(t + 3, 3)).Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Next
End Sub


"Curt" skrev:

is there a way to sort by cells in a column also can you repeat the search
after first group are reached. column has many groups of numbers want to
group by 1 to 4 repeated. have not been able to get it to sort allways puts
all 1s 2s together. Want a 1234 group.
Anyone? I'm beat
thanks



--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Sorting Sorting Sorting Skydiver Excel Discussion (Misc queries) 4 June 3rd 06 02:42 PM
Sorting Data in ascending order sharon2006 Excel Discussion (Misc queries) 1 March 14th 06 01:07 AM
SORTING question Rebecca New Users to Excel 3 February 24th 05 05:35 PM
Adding a KeyID column for sorting Rebecca New Users to Excel 3 February 20th 05 07:09 PM


All times are GMT +1. The time now is 05:19 AM.

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"