Not sure if this change will work.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("M2:M" & ActiveSheet.UsedRange.Rows.count + 1)) Is Nothing Then
        Range("A2:M" & ActiveSheet.UsedRange.Rows.count + 1).Select
        Selection.Sort Key1:=Range("M2"), Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
End If
Range("A2:M" & ActiveSheet.UsedRange.Rows.count + 1).interior.colorindex = xlnone
End Sub