Find the last cell address using vba excel

前端 未结 4 526
我在风中等你
我在风中等你 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:35

    This will give the last row in a given column

    = Cells(Activesheet.Rows.Count, ColumnNumber).End(xlUp).Row (Fixed per @Gimp)

    you then have a reference you can use to add to the data - e.g if you want to look in column "A", then that would be columnnumber 1. feed that into the function, then you can use Cells(NumberReturnedFromFunction,ColumnNumber) to address that cell, and add .Address if you want the A1 style of address

提交回复
热议问题