LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Sort multiple columns on all worksheets

I am trying to sort each worksheet by 2 different columns. I want all
sheets to be sorted by column A ascending and then some sheets sorted
by E and the rest by C. Here is the code that I Have. It does nto do
what I want, but I feel that it is close. any help would be greatly
appreciated. Here is the code.

Thanks,
Jay

Sub SortSheets()
Dim wsSheet As Worksheet

For Each wsSheet In Worksheets
Dim Ws As String
Ws = wsSheet.Name
If Ws < "Rosback" And Ws < "Cutting" And Ws < "Gluer" And Ws <
"Folding" And _
Ws < "Lookup Sheet" Then

Range("A5:AZ5000").Sort Key1:=Range("A4"),
Order1:=xlAscending, _
key2:=Range("E4"), Header:=xlGuess, OrderCustom:=1,
MatchCase:=False, _
Orientation:=xlTopToBottom
ElseIf Ws = "Rosback" Or Ws = "Cutting" Or Ws = "Folding" Or Ws =
"Gluer" Then
Range("A5:AZ5000").Sort Key1:=Range("A4"),
Order1:=xlAscending, _
key2:=Range("c4"), Header:=xlGuess, OrderCustom:=1,
MatchCase:=False, _
Orientation:=xlTopToBottom
End If
Next wsSheet
End Sub
 
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
how can i re-sort multiple worksheets into alphabetical order Stuart Excel Discussion (Misc queries) 3 May 22nd 10 07:35 AM
Need Simple List...Multiple Columns and Multiple Worksheets Jane Doe[_3_] Excel Worksheet Functions 6 July 14th 08 08:12 PM
Sort multiple columns with multiple formulas without returning #R bellsjrb Excel Worksheet Functions 0 July 14th 06 10:01 AM
sort data on multiple worksheets bill Excel Discussion (Misc queries) 0 November 29th 05 05:52 PM
Sort rows across multiple worksheets - Excel 2003 Stamdale Excel Worksheet Functions 2 July 5th 05 04:30 PM


All times are GMT +1. The time now is 04:03 PM.

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"