Hi
I got a simple macro from a google search How to sort data on multiple worksheets at once?
Basically it is sorting data on many sheets.
However I can't get it to start excluding headers ?
This is what I ran as the macro (adjusted according to my data set) ... but my headers start at row #3 ... and I cannot figure out which line below engages that.
Sub SortAllSheets()
'Updateby Extendoffice
Dim WS As Worksheet
Dim xIntR As Integer
ActiveSheet.Range("A1:F1").Select
On Error Resume Next
Application.ScreenUpdating = False
For Each WS In Worksheets
xIntR = Intersect(WS.UsedRange, WS.Range("A:F")).Rows.Count
WS.Range("A2:F" & xIntR).Sort Key1:=WS.Range("A2:A" & xIntR), Order1:=xlDescending
Next WS
Application.ScreenUpdating = True
End Sub
FYI: I've also tried to do some more google searches but come across the same issue.
Can anyone help ??
Thanks
I got a simple macro from a google search How to sort data on multiple worksheets at once?
Basically it is sorting data on many sheets.
However I can't get it to start excluding headers ?
This is what I ran as the macro (adjusted according to my data set) ... but my headers start at row #3 ... and I cannot figure out which line below engages that.
Sub SortAllSheets()
'Updateby Extendoffice
Dim WS As Worksheet
Dim xIntR As Integer
ActiveSheet.Range("A1:F1").Select
On Error Resume Next
Application.ScreenUpdating = False
For Each WS In Worksheets
xIntR = Intersect(WS.UsedRange, WS.Range("A:F")).Rows.Count
WS.Range("A2:F" & xIntR).Sort Key1:=WS.Range("A2:A" & xIntR), Order1:=xlDescending
Next WS
Application.ScreenUpdating = True
End Sub
FYI: I've also tried to do some more google searches but come across the same issue.
Can anyone help ??
Thanks