I have a workbook with around 20 worksheets. Sheets 2 through 20 are formatted the same. I want a macro to sort the data in columns A through D, based on the values in column A and I want the macro to cycle through every sheet, EXCEPT for sheet 1... Every sheet has a custom name. (ie, Sheet number 2 is ABC)...
I used the record macro command to generate the following code and was wondering if someone could help me adapt it to my needs:
Sub Sort()
'
' Sort Macro
' Sort columns A thru D based on values in column A
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Columns("A:D").Select
ActiveWorkbook.Worksheets("ABC").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("ABC").Sort.SortFields.Add Key:=Range("A2:A1000"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("ABC").Sort
.SetRange Range("A2:D1000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
I'd appreciate any help!
Bookmarks