dtrusnik06
New Member
- Joined
- Feb 2, 2018
- Messages
- 1
I am using the following macro to auto sort entire rows by dates entered into column "N". The first row in the data that needs to be sorted is "4". I will need this to auto sort any rows that are added into worksheet and dates entered. It was working fine but it just started not auto sorting entire row, it only auto sorts the dates in column "N". Is there any fix that will solve this for me?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("N:N")) Is Nothing Then
Range("N4").Sort Key1:=Range("N5"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("N:N")) Is Nothing Then
Range("N4").Sort Key1:=Range("N5"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub