ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can I find last populated cell in a row (or column) (https://www.excelbanter.com/excel-programming/298540-re-how-can-i-find-last-populated-cell-row-column.html)

Frank Kabel

how can I find last populated cell in a row (or column)
 
Hi
for a column try something like
sub foo()
Dim Lastrow
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
msgbox lastrow
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


alekm wrote:
Hi,
how can I find last populated (not null) cell in a row (or column)

thanx

alekm


gigglefritz

how can I find last populated cell in a row (or column)
 
Hey Frank! The guy asked for the cell, not the row!

-----Original Message-----
Hi
for a column try something like
sub foo()
Dim Lastrow
LastRow = ActiveSheet.Cells(Rows.Count, "A").End

(xlUp).row
msgbox lastrow
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


alekm wrote:
Hi,
how can I find last populated (not null) cell in a row

(or column)

thanx

alekm

.


Frank Kabel

how can I find last populated cell in a row (or column)
 
Hi
o.k. agreed. use
msgbox cells(lastrow,"A")

--
Regards
Frank Kabel
Frankfurt, Germany


gigglefritz wrote:
Hey Frank! The guy asked for the cell, not the row!

-----Original Message-----
Hi
for a column try something like
sub foo()
Dim Lastrow
LastRow = ActiveSheet.Cells(Rows.Count, "A").End (xlUp).row
msgbox lastrow
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


alekm wrote:
Hi,
how can I find last populated (not null) cell in a row (or column)

thanx

alekm

.



All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com