Private Sub Worksheet_Change(ByVal Target As Range)
Dim tblT As ListObject
Dim rngSortCol As Range
Set tblT = Me.ListObjects("Table1")
Set rngSortCol = Range("Table1[Priority]")
If Intersect(Target, rngSortCol) Is Nothing Then Exit Sub
'Turn off events to keep out of loops
Application.EnableEvents = False
With tblT.Sort
.SortFields.Clear
.SortFields.Add Key:=rngSortCol, Order:=xlAscending
.Apply
End With
With rngSortCol
.FormulaR1C1 = "=ROW()-" & tblT.HeaderRowRange.Row
.Copy
.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
Target.Select
'Turn events back on to get ready for the next change
Application.EnableEvents = True
End Sub