Find the last cell address using vba excel

前端 未结 4 529
我在风中等你
我在风中等你 2020-12-11 00:07

I have searched this site and it seems like all the answers just point to finding the row number of the cell.

I am trying to set a range so that it will go from

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 00:54

    In case there are gaps in the data I'd avoid using xlDown so something like the following is fine. Try it in the immediate window:

    Activesheet.range("A1:A" & Activesheet.Cells(Excel.Rows.Count, 1).End(Excel.xlUp).Row).select
    

提交回复
热议问题