This macro is in the sheet module. Any changes to column H or J will cause all the groups to autosort so they are all updated all the time.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each cell In Target
If (cell.Column = 10 And cell <> "" And cell.Offset(, -2) <> "") Or _
cell.Column = 8 And cell <> "" And cell.Offset(, 2) <> "" Then
Range("O12:Y16").Sort Key1:=Range("X12"), Order1:=xlAscending, _
Key2:=Range("Y12"), order2:=xlAscending, header:=xlYes
Range("O20:Y24").Sort Key1:=Range("X20"), Order1:=xlAscending, _
Key2:=Range("Y20"), order2:=xlAscending, header:=xlYes
Range("O28:Y32").Sort Key1:=Range("X28"), Order1:=xlAscending, _
Key2:=Range("Y28"), order2:=xlAscending, header:=xlYes
Range("O36:Y40").Sort Key1:=Range("X36"), Order1:=xlAscending, _
Key2:=Range("Y36"), order2:=xlAscending, header:=xlYes
Range("O44:Y48").Sort Key1:=Range("X44"), Order1:=xlAscending, _
Key2:=Range("Y44"), order2:=xlAscending, header:=xlYes
Range("O52:Y56").Sort Key1:=Range("X52"), Order1:=xlAscending, _
Key2:=Range("Y52"), order2:=xlAscending, header:=xlYes
Range("O60:Y64").Sort Key1:=Range("X60"), Order1:=xlAscending, _
Key2:=Range("Y60"), order2:=xlAscending, header:=xlYes
Range("O68:Y72").Sort Key1:=Range("X68"), Order1:=xlAscending, _
Key2:=Range("Y68"), order2:=xlAscending, header:=xlYes
End If
Next cell
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Bookmarks