Automatic sort excel rows when data changes. VBA code included

preview_player
Показать описание
VBA code:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("J:J")) Is Nothing Then
Range("J4").Sort Key1:=Range("J5"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub

Make sure you save your workbook as macro-enabeled workbook and change correct ranges in code.

you want descending list just change ascending to descending in code.
Рекомендации по теме
Комментарии
Автор

how do i do this for a column with formula imputs

averagejoe