VBA Excel sort range by specific column

后端 未结 3 447
名媛妹妹
名媛妹妹 2020-11-30 02:26

I have a table that can contain any number of rows:

\"enter

As I said it can c

3条回答
  •  臣服心动
    2020-11-30 03:10

    If the starting cell of the range and of the key is static, the solution can be very simple:

    Range("A3").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Sort key1:=Range("B3", Range("B3").End(xlDown)), _
    order1:=xlAscending, Header:=xlNo
    

提交回复
热议问题