Find last row in range

前端 未结 11 2021
傲寒
傲寒 2020-12-02 00:41

I\'m having a little trouble with finding the last row.

What I am trying to do is find the last row in column "A", then use that to find the last row within

11条回答
  •  情歌与酒
    2020-12-02 01:35

    If your wbshtSelect is defined as worksheet and you have used set to define the specific worksheet, you can use this.

     Dim LastRow As Long
    
     wbshtSelect.UsedRange ' Refresh UsedRange
     LastRow = wbshtSelect.UsedRange.Rows(wbshtSelect.UsedRange.Rows.Count).Row
    

    Otherwise take a look here http://www.ozgrid.com/VBA/ExcelRanges.htm

提交回复
热议问题