Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_Deactivate()
- Sort_CategoryProject_Group
- End Sub
- Sub Sort_CategoryProject_Group()
- '9A14
- 'Sort after Project Name
- Dim lastRow As Byte
- lastRow = Sheets(pubWsCategory).Cells(Rows.Count, 12).End(xlUp).Row
- Sheets(pubWsCategory).Range("L4:U" & lastRow).Select
- ActiveWorkbook.Worksheets(pubWsCategory).Sort.SortFields.Clear
- ActiveWorkbook.Worksheets(pubWsCategory).Sort.SortFields.Add Key:=Range("L4:L" & lastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- ActiveWorkbook.Worksheets(pubWsCategory).Sort.SortFields.Add Key:=Range("M4:M" & lastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets(pubWsCategory).Sort
- .SetRange Range("L4:U" & lastRow)
- .Header = xlYes
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- Application.CutCopyMode = False
- Range("B4").Select
- End Sub
Add Comment
Please, Sign In to add comment