I have a sheet with four columns (Company, Activity, People, Date) and I'm trying to have the document automatically sort by date whenever a new activity & date is entered.
I'd set up a VBA sort code to automatically sort information using this code:
It worked perfectly when I first set it up and tested it. I saved the document and when I opened it this morning it's no longer automatically sorting when I enter new dates or change existing dates. I don't know what's happening. Please help!
I'd set up a VBA sort code to automatically sort information using this code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Range("D1").Sort Key1:=Range("D45"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
Last edited by a moderator: