It is quite possible with a VBA macro.
- The table you want to sort, you name it "news"
- the cell under the first sort column named "col1"
- the cell under the second sort column is called "col2"
- the cell under the third sort column is called "col3"
All these names are examples used in the macro of course. You have to this macro in the sheet in question and whenever a cell changes value table is sorted.
Code:
Private Sub Worksheet_Change (ByVal adrcel As Range)
Range ("Information"). Sort Key1: = Range ("col1"), Order1: = xlAscending, _
Key2: = Range ("col2") ORDER2: = xlAscending, _
Key3: = Range ("col3") ORDER3: = xlAscending, _
Header: = xlYes, OrderCustom: = 1, MatchCase: = False, _
Orientation: = xlTopToBottom
End Sub
It is obvious that this is a working example but it can be improved by ensuring that the modified cell is actually part of the table for example.
Bookmarks