dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
I have data that needs sorting by date first and then request number within each date range.
This is my code
This is my code
VBA Code:
Sub Sorting()
'This code sorts by the date first and within each date, it sorts the rows by the request number
With ActiveSheet.Sort
.SortFields.Add Key:=Range("A3"), order:=xlAscending
.SortFields.Add Key:=Range("C3"), order:=xlAscending
.SetRange Range("A3", Range("O" & Rows.Count).End(xlDown))
.Header = xlYes
.Apply
End With
End Sub
- The header row is row 3
- Date is column A
- Request number is column C