Good Afternoon,
I am trying to automatically sort scores in a table from high to low using VBA in Office 2019. The table is B2-13 & C2-13.
I found some code on Youtube that worked in the video but not in my workbook. Code is below. Am I looking in the wrong place?
Many Thanks for your help.
Steve Walker
I am trying to automatically sort scores in a table from high to low using VBA in Office 2019. The table is B2-13 & C2-13.
I found some code on Youtube that worked in the video but not in my workbook. Code is below. Am I looking in the wrong place?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 3 Then
Dim lastrow As Long
lastrow = Cells(Rows.Count, 3).End(xlUp).Row
Range("B2:C" & lastrow).Sort key1:=Range("C2:C" & lastrow), order1:=xlDecending, Header:=xlNo
End If
End Sub
Many Thanks for your help.
Steve Walker
Last edited by a moderator: