How to auto sort column for Column J first after new data key in even column M not fill up yet?
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("J:J, M:M")) Is Nothing Then
If Target.CountLarge > 1 Then Exit Sub
If Range("J" & Target.Row) <> "" And Range("M" & Target.Row) <> "" Then
Range("J1:M" & Range("J" & Rows.Count).End(1).Row).Sort _
key1:=Range("J1"), order1:=xlAscending, key2:=Range("M1"), order2:=xlAscending, Header:=xlYes
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("J:J, M:M")) Is Nothing Then
If Target.CountLarge > 1 Then Exit Sub
If Range("J" & Target.Row) <> "" And Range("M" & Target.Row) <> "" Then
Range("J1:M" & Range("J" & Rows.Count).End(1).Row).Sort _
key1:=Range("J1"), order1:=xlAscending, key2:=Range("M1"), order2:=xlAscending, Header:=xlYes
End If
End If
End Sub