How can I find last row that contains data in a specific column?

后端 未结 13 1595
南笙
南笙 2020-11-22 03:44

How can I find the last row that contains data in a specific column and on a specific sheet?

13条回答
  •  被撕碎了的回忆
    2020-11-22 04:27

    Simple and quick:

    Dim lastRow as long
    Range("A1").select
    lastRow = Cells.Find("*",SearchOrder:=xlByRows,SearchDirection:=xlPrevious).Row
    

    Example use:

    cells(lastRow,1)="Ultima Linha, Last Row. Youpi!!!!"
    
    'or 
    
    Range("A" & lastRow).Value = "FIM, THE END"
    

提交回复
热议问题