Can someone help me loop this macro on all worksheets? (theres 47)
Code:
Sub AM2_Format_Util_Template()
'
' AM2_Format_Util_Template Macro
'
'
Columns("AC:AC").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("B:B").Select
Application.CutCopyMode = False
Selection.Copy
Columns("W:W").Select
ActiveSheet.Paste
Columns("AG:AG").Select
ActiveSheet.Paste
Columns("A:T").Select
Range("T1").Activate
Selection.EntireColumn.Hidden = True
Columns("U:AC").Select
Range("AC1").Activate
Application.CutCopyMode = False
Selection.Copy
Columns("AD:AD").Select
Selection.Insert Shift:=xlToRight
Columns("AO:BB").Select
Application.CutCopyMode = False
Selection.Copy
Columns("BD:BD").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("BG2:BG38090" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("AMC").Sort
.SetRange Range("BD1:BQ38090")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("AO:BB").Select
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("AQ2:AQ38091" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("AMC").Sort
.SetRange Range("AO1:BB38091")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.SmallScroll ToRight:=-15
Columns("AE:AL").Select
Range("AL1").Activate
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("AL2:AL38092" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("AH2:AH38092" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("AMC").Sort
.SetRange Range("AE1:AL38092")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("V:AC").Select
Range("AC1").Activate
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("AC2:AC38093" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("AMC").Sort.SortFields.Add Key:=Range("X2:X38093") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("AMC").Sort
.SetRange Range("V1:AC38093")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub