Private Sub Workbook_Open()
Call Organize_Macro
End Sub
Sub Organize_Macro()
'
' Sort sheet upon open
'
Application.ScreenUpdating = False
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"B2:B501"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("A1:B501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"K2:K501"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("J1:K501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"S2:S501"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("R1:S501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"Z2:Z501"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("Y1:Z501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"AH2:AH501"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Hardware").Sort
.SetRange Range("AG1:AH501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"AP2:AP501"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("AO1:AP501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Worksheets("Hardware").Sort.SortFields.Clear
Worksheets("Hardware").Sort.SortFields.Add Key:=Range( _
"AX2:AX501"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With Worksheets("Hardware").Sort
.SetRange Range("AW1:AX501")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Sheets("Panel").Select
Range("A12").Select
Application.ScreenUpdating = True
End Sub