Determine last non-value (may have a formula) row in column

前端 未结 4 1415
一向
一向 2021-01-22 13:59

I have a column that has a formula in each row field. The formula propagates data from another Excel spreasheet. If there is nothing in the row field, though, the row remains bl

4条回答
  •  日久生厌
    2021-01-22 14:49

    If you want to find the last row that contains a non-blank value (either produced by a formula or by entering a constant) try this

    Sub FindLastValue()
    Dim jLastRow As Long
    jLastRow = ActiveSheet.Cells.Find(What:="*", LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    End Sub
    

提交回复
热议问题