Determine cell address of last entry in a row

N

NDBC

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
 
J

Jacob Skaria

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
 
S

stanleydgromjr

NDBC,

Try:


Code
-------------------


Dim MaxA As Long

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


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



Have a great day,
Sta
 
N

NDBC

Thanks Stanley, I had already modified Jacobs code to that. Thanks again
Jacob. I'm starting to wonder if you ever sleep.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top