Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("E2:E" & Rows.Count), Target) Is Nothing Then
If IsDate(Target.Value) Then
Target.Offset(, 1).Value = 1
Range("A1").CurrentRegion.Sort Key1:=Range("F1"), Order1:=xlAscending, Header:=xlYes
Range("F:F").ClearContents
End If
End If
End Sub
I put this code in sheet but it's not working,( column f is date column )
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("F3:F" & Rows.Count), Target) Is Nothing Then
If IsDate(Target.Value) Then
Target.Offset(, 1).Value = 1
Range("B2:G" & Range("B" & Rows.Count).End(xlUp).Row).Sort Key1:=Range("G2"), Order1:=xlAscending, Header:=xlYes
Range("G:G").ClearContents
End If
End If
End Sub