freddie mitchell
New Member
- Joined
- Apr 14, 2011
- Messages
- 43
Hello everyone,
A question on a code I'm using to auto sort a table by date, included below. Is it possible to add an IF clause to ignore / skip over non-numerical values from the code? For example, if someone were to change a pre-existing date in the worksheet to "September" the code would not try to auto sort it!
Thank you for the help, you're all super
A question on a code I'm using to auto sort a table by date, included below. Is it possible to add an IF clause to ignore / skip over non-numerical values from the code? For example, if someone were to change a pre-existing date in the worksheet to "September" the code would not try to auto sort it!
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Range("A4").Sort Key1:=Range("A5"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub
Thank you for the help, you're all super