Excel VBA - select a dynamic cell range

前端 未结 4 1607
猫巷女王i
猫巷女王i 2020-12-13 11:08

I want to be able to dynamically select a range of cells (the heading row), where the row is 1 but the columns with be for 1 to last column, where \"A\" is the first Column

4条回答
  •  旧巷少年郎
    2020-12-13 11:58

    sub selectVar ()
        dim x,y as integer
        let srange = "A" & x & ":" & "m" & y
        range(srange).select
    end sub
    

    I think this is the simplest way.

提交回复
热议问题