Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
i have over 100 worksheets and it will grow, they all have the same columns.
I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
Hi
This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
Do you want every sheet sorted or are there some sheets that you want
skipped? HTH Otto "tkincaid" wrote in message ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
For Each sht In Sheets sht.Cells.Sort _ Key1:=sht.Range("B1"), _ Order1:=xlAscending, _ Header:=xlGuess Next sht "tkincaid" wrote: i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
Yes every sheet sorted.
"Otto Moehrbach" wrote: Do you want every sheet sorted or are there some sheets that you want skipped? HTH Otto "tkincaid" wrote in message ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
yes every sheet
"Otto Moehrbach" wrote: Do you want every sheet sorted or are there some sheets that you want skipped? HTH Otto "tkincaid" wrote in message ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
yes
"Otto Moehrbach" wrote: Do you want every sheet sorted or are there some sheets that you want skipped? HTH Otto "tkincaid" wrote in message ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
I copied this and it didn't work, and I do have headings in row 1 all my
information starts on line 3 column a all the way to J 98, but I want to sort via column B which is the date. Sorry for the post, it told me it didn't send, but it did. "Per Jessen" wrote: Hi This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
Try this:
Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Range("A3:J98").Sort Key1:=Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... I copied this and it didn't work, and I do have headings in row 1 all my information starts on line 3 column a all the way to J 98, but I want to sort via column B which is the date. Sorry for the post, it told me it didn't send, but it did. "Per Jessen" wrote: Hi This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
this works, but only if I am on the sheet, I want to run a macro after all
data is entered and run it once to do all sheets. thanks "Per Jessen" wrote: Try this: Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Range("A3:J98").Sort Key1:=Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... I copied this and it didn't work, and I do have headings in row 1 all my information starts on line 3 column a all the way to J 98, but I want to sort via column B which is the date. Sorry for the post, it told me it didn't send, but it did. "Per Jessen" wrote: Hi This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
My fault :-(
This will sort all sheets at once. Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets With sh .Range("A3:J98").Sort Key1:=.Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End With Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... this works, but only if I am on the sheet, I want to run a macro after all data is entered and run it once to do all sheets. thanks "Per Jessen" wrote: Try this: Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Range("A3:J98").Sort Key1:=Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... I copied this and it didn't work, and I do have headings in row 1 all my information starts on line 3 column a all the way to J 98, but I want to sort via column B which is the date. Sorry for the post, it told me it didn't send, but it did. "Per Jessen" wrote: Hi This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
#12
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort column ascending on many worksheets
thank you so much for your help, I don't know what I would do without this
forum. thanks "Per Jessen" wrote: My fault :-( This will sort all sheets at once. Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets With sh .Range("A3:J98").Sort Key1:=.Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End With Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... this works, but only if I am on the sheet, I want to run a macro after all data is entered and run it once to do all sheets. thanks "Per Jessen" wrote: Try this: Sub SortSheets() Dim sh Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Range("A3:J98").Sort Key1:=Range("B3"), Order1:=xlAscending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... I copied this and it didn't work, and I do have headings in row 1 all my information starts on line 3 column a all the way to J 98, but I want to sort via column B which is the date. Sorry for the post, it told me it didn't send, but it did. "Per Jessen" wrote: Hi This macro will sort all sheets based on column B, assuming you have headings in row 1. Sub SortSheets() Application.ScreenUpdating = False For Each sh In ThisWorkbook.Sheets Columns("A:H").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Next Application.ScreenUpdating = True End Sub Regards, Per "tkincaid" skrev i meddelelsen ... i have over 100 worksheets and it will grow, they all have the same columns. I want to make a macro that will sort each worksheet via column B with dates. A B C all 12/8/08 all-t-08-e-001 The columns continue until H and go to line 98. Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Column sort with Ascending / Descending Arrows | Excel Worksheet Functions | |||
Using Sort Ascending while filtering another column | Excel Discussion (Misc queries) | |||
How to sort worksheets in alphabetical order (descending or ascending)? | Excel Discussion (Misc queries) | |||
How do I arrange/sort worksheets in ascending order? | Excel Discussion (Misc queries) | |||
Excel worksheets needs to sort ascending or descending order. | Excel Worksheet Functions |