ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Determine cell address of last entry in a row (https://www.excelbanter.com/excel-discussion-misc-queries/237635-determine-cell-address-last-entry-row.html)

NDBC

Determine cell address of last entry in a row
 
I need to find the column number of the last entry in a row. I tried this but
it doesn't seem to work

MaxA = Sheets("A Grade").Cells(Columns.Count, "5").End(xlLeft).Column

I'm trying to find the column address of the last entry in the 5th row down.

Thanks



Jacob Skaria

Determine cell address of last entry in a row
 
the below will give you the column number of the last entry in Row 1

lngLastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

I need to find the column number of the last entry in a row. I tried this but
it doesn't seem to work

MaxA = Sheets("A Grade").Cells(Columns.Count, "5").End(xlLeft).Column

I'm trying to find the column address of the last entry in the 5th row down.

Thanks



stanleydgromjr[_8_]

Determine cell address of last entry in a row
 

NDBC,

Try:


Code:
--------------------


Dim MaxA As Long

MaxA = Sheets("A Grade").Cells(5, Columns.Count).End(xlToLeft).Column


--------------------



Have a great day,
Stan


--
stanleydgromjr
------------------------------------------------------------------------
stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=118352


NDBC

Determine cell address of last entry in a row
 
Thanks Stanley, I had already modified Jacobs code to that. Thanks again
Jacob. I'm starting to wonder if you ever sleep.

"stanleydgromjr" wrote:


NDBC,

Try:


Code:
--------------------


Dim MaxA As Long

MaxA = Sheets("A Grade").Cells(5, Columns.Count).End(xlToLeft).Column


--------------------



Have a great day,
Stan


--
stanleydgromjr
------------------------------------------------------------------------
stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=118352




All times are GMT +1. The time now is 05:52 AM.

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