VBA - Select columns using numbers?

前端 未结 9 2188
北荒
北荒 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:18

    In the example code below I use variables just to show how the command could be used for other situations.

    FirstCol = 1
    LastCol = FirstCol + 5
    Range(Columns(FirstCol), Columns(LastCol)).Select
    

提交回复
热议问题