Hi All,
I have dynamic data in my worksheet (named "Setup" currently but could change) which I am looking to apply a multi-level sort to.
The current dataset starts from A4 and ends at AD37 however this could also change as more data in rows and columns is added. The headers are in the third row while the first two rows are blank to house the macro buttons.
Below is the code I am currently using but need to tweak it to specify that the headers are in the second row rather than the first row.
Any help is greatly appreciated.
Sub MultiLevelSort()
Worksheets("Setup").Sort.SortFields.Clear
'Worksheets("Setup").UsedRange.Sort Key1:=Range("b3"), Key2:=Range("C3"), Key2:=Range("D3"), Header:=xlYes, _
'Order1:=xlAscending, Order2:=xlAscending, Order3:=xlDescending
End Sub
I have dynamic data in my worksheet (named "Setup" currently but could change) which I am looking to apply a multi-level sort to.
The current dataset starts from A4 and ends at AD37 however this could also change as more data in rows and columns is added. The headers are in the third row while the first two rows are blank to house the macro buttons.
Below is the code I am currently using but need to tweak it to specify that the headers are in the second row rather than the first row.
Any help is greatly appreciated.
Sub MultiLevelSort()
Worksheets("Setup").Sort.SortFields.Clear
'Worksheets("Setup").UsedRange.Sort Key1:=Range("b3"), Key2:=Range("C3"), Key2:=Range("D3"), Header:=xlYes, _
'Order1:=xlAscending, Order2:=xlAscending, Order3:=xlDescending
End Sub