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

后端 未结 13 1587
南笙
南笙 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:31

    Public Function LastData(rCol As Range) As Range    
        Set LastData = rCol.Find("*", rCol.Cells(1), , , , xlPrevious)    
    End Function
    

    Usage: ?lastdata(activecell.EntireColumn).Address

提交回复
热议问题