在给定列号的情况下,如何为整列找到并存储范围对象?谢谢!
答案 0 :(得分:2)
使用Columns
属性
Dim rng as Range
Set rng = ThisWorkbook.Worksheets(1).Columns(12) ' for column 12
答案 1 :(得分:0)
怎么样:
Sub PickAColumn()
Dim i As Long
Dim MyColumn As Range
i = Application.InputBox(Prompt:="Enter Column NUMBER ", Type:=1)
Set MyColumn = Cells(1, i).EntireColumn
MyColumn.Select
End Sub