sorting data on multiple sheets

  • Thread starter Thread starter jer
  • Start date Start date
J

jer

Hi all
Is there a way to sort data on multiple sheets in a
workbook? The headings are similiar for all sheets
thank for any help
jer
 
jer,

This will sort all the sheets in a workbook the same way.
I have it set for the first column, then the second, both
in ascending. You can change the sorts, but it will apply
the same sorting to all sheets. It does use the column
Header names, so the column you are sorting on must be in
same location in each sheet.

Sub standardSort()

For iSheet = 1 To ActiveWorkbook.Sheets.Count
Sheets(iSheet).Visible = True
Sheets(iSheet).Select
Cells.Select
Selection.Sort Key1:=Range("A2"),
Order1:=xlAscending, Key2:=Range("B2") _
, Order2:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom,
DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select

Next iSheet
End Sub
 
jer,

Do you want each sheet sorted, or all the data in the sheets sorted as if in
one big table (so it's sequential as you go through the sheets)?
 
Jer,

I think you'll have to sort each. A macro could automate it, stepping
through each sheet and initiating a sort. If you record a macro, you'll
need to ensure that the sorts will include added data.
 
Back
Top