VBA - Select columns using numbers?

前端 未结 9 2191
北荒
北荒 2021-02-05 08:06

I\'m looking for an alternative to this code, but using numbers. I want to select 5 columns, the start column is a variable, and then it selects 5 columns from this

9条回答
  •  粉色の甜心
    2021-02-05 08:37

    You can use resize like this:

    For n = 1 To 5
        Columns(n).Resize(, 5).Select
        '~~> rest of your code
    Next
    

    In any Range Manipulation that you do, always keep at the back of your mind Resize and Offset property.

提交回复
热议问题