So I have the following code:
I want to sort the values in column A in ascending order (the header consists of rows 1 and 2 merged) only if a cell in column A is changed. But when I change a cell in column A with this code in place, nothing happens. Any help?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Columns(1).Sort key1:=Range("A3"), order1:=xlAscending, Header:=xlYes
End If
Application.EnableEvents = True
End Sub
I want to sort the values in column A in ascending order (the header consists of rows 1 and 2 merged) only if a cell in column A is changed. But when I change a cell in column A with this code in place, nothing happens. Any help?