Afternoon,
I have a spreadsheet that I am trying to write a macro to sort First by Column B (Date), then by Column A (Day) then by column C (Group).
I realise that sorting by date then day may seem redundant, but the date may not always be filled in.
My issue is that I can only seem to get the weekday sort order on the 1st key (column A) and not on Column B (Day) like I need. Below is the code I have got so far from recording the action. Does anyone know how this needs to be amended to do what I need. If so I would be very grateful.
I have a spreadsheet that I am trying to write a macro to sort First by Column B (Date), then by Column A (Day) then by column C (Group).
I realise that sorting by date then day may seem redundant, but the date may not always be filled in.
My issue is that I can only seem to get the weekday sort order on the 1st key (column A) and not on Column B (Day) like I need. Below is the code I have got so far from recording the action. Does anyone know how this needs to be amended to do what I need. If so I would be very grateful.
Code:
Cells.Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("A2") _
, Order2:=xlAscending, Key3:=Range("C2"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=3, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal