To set Auto Sort on desire columns while open the Workbook, you need this Macro(VBA).
Private Sub Worksheet_Open()
Columns("D:D").Select
Selection.Sort Key1:=Range("D6"), Order1:=xlDescending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Columns("J:J").Select
Selection.Sort Key2:=Range("J6"), Order1:=xlDescending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
How it works:
- Press
Alt+F11
to open VB editor.
- On top left in
Project Explorer windows
find ThisWorkbook
.
Double click
it then Copy & Paste
this Code.
Save
& Close
the Workbook.
Note:
Now, every time you open the Workbook Excel will RUN this code to Sort data on specified Columns.