Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default 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
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
Column sort with Ascending / Descending Arrows JT Excel Worksheet Functions 3 May 18th 08 02:40 AM
Using Sort Ascending while filtering another column Jack Excel Discussion (Misc queries) 0 January 17th 08 02:14 PM
How to sort worksheets in alphabetical order (descending or ascending)? [email protected] Excel Discussion (Misc queries) 2 June 14th 07 10:13 PM
How do I arrange/sort worksheets in ascending order? PurpleRain Excel Discussion (Misc queries) 3 October 20th 06 06:41 AM
Excel worksheets needs to sort ascending or descending order. Md. Mahfuzul Mannan Excel Worksheet Functions 1 September 3rd 06 05:04 PM


All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"