L lo032398 Jun 22, 2004 #1 I have a macro which works out the last row in a column of data. I wan to put the row number in a Cell. How can I do this ? Thank
I have a macro which works out the last row in a column of data. I wan to put the row number in a Cell. How can I do this ? Thank
H Hans Jun 22, 2004 #2 Hi Following macro puts the last row number of the Range starting in A1 in cell B1. regards Sub Macro11() Dim lLastRow As Long Dim rgLast As Range Set rgLast = Range("A1").SpecialCells(xlCellTypeLastCell) lLastRow = rgLast.Row Range("A1").Value = lLastRow End Sub
Hi Following macro puts the last row number of the Range starting in A1 in cell B1. regards Sub Macro11() Dim lLastRow As Long Dim rgLast As Range Set rgLast = Range("A1").SpecialCells(xlCellTypeLastCell) lLastRow = rgLast.Row Range("A1").Value = lLastRow End Sub