我有一个列表,并且希望在列c4:c150值更改时对此列表进行排序。 我在Worksheet_Change下面的代码中使用但不工作!任何机构来帮助我?使用vba在excel中对特定列进行排序
Dim KeyCells As Range
Set KeyCells = Range("C4:C150")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
Columns("A:C").Sort key1:=Range("C4"), order1:=xlDescending, Header:=xlYes
End If
enter image description hereenter image description here