Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can i re-sort multiple worksheets into alphabetical order | Excel Discussion (Misc queries) | |||
Need Simple List...Multiple Columns and Multiple Worksheets | Excel Worksheet Functions | |||
Sort multiple columns with multiple formulas without returning #R | Excel Worksheet Functions | |||
sort data on multiple worksheets | Excel Discussion (Misc queries) | |||
Sort rows across multiple worksheets - Excel 2003 | Excel Worksheet Functions |