ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Identifying last row number (https://www.excelbanter.com/excel-programming/369578-identifying-last-row-number.html)

Maxi[_2_]

Identifying last row number
 
I have data in range A1 to A10. I want to find the first blank cell in
column A which is at A11. Therefore the VBA should give result as 11.


Harald Staff

Identifying last row number
 
http://www.contextures.com/xlfaqMac.html#Empty

HTH. Best wishes Harald

"Maxi" skrev i melding
ups.com...
I have data in range A1 to A10. I want to find the first blank cell in
column A which is at A11. Therefore the VBA should give result as 11.




Bob Phillips

Identifying last row number
 
All you need is

FirstEmptyRow = Range("A1").End(xlDown).Row + 1

If you want the first blank cell after the last data cell where there may be
embedded blanks, e.g. A3 and a4 may be blank, but A5 is not, then us

EmptyRow = Cells(Rows.Count,"A").End(xlUp).Row + 1

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Maxi" wrote in message
ups.com...
I have data in range A1 to A10. I want to find the first blank cell in
column A which is at A11. Therefore the VBA should give result as 11.




godonnygo[_5_]

Identifying last row number
 

Kind of similar to this, I was wondering how to find the last 5
non-blank items in a range (which just say I've called "TheRange")


--
godonnygo
------------------------------------------------------------------------
godonnygo's Profile: http://www.excelforum.com/member.php...o&userid=37124
View this thread: http://www.excelforum.com/showthread...hreadid=568925


Bob Phillips

Identifying last row number
 
Are they contiguous? If so just use

LastRow = Cells(Rows.Count,"A").End(xlUp).Row
Set MyRange = Cells(LastRow,"A").Offset(-4,0).Resize(5)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"godonnygo" wrote
in message ...

Kind of similar to this, I was wondering how to find the last 5
non-blank items in a range (which just say I've called "TheRange")


--
godonnygo
------------------------------------------------------------------------
godonnygo's Profile:

http://www.excelforum.com/member.php...o&userid=37124
View this thread: http://www.excelforum.com/showthread...hreadid=568925




Maxi[_2_]

Identifying last row number
 
Thanks Bob. Issue resolved


Bob Phillips wrote:
Are they contiguous? If so just use

LastRow = Cells(Rows.Count,"A").End(xlUp).Row
Set MyRange = Cells(LastRow,"A").Offset(-4,0).Resize(5)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"godonnygo" wrote
in message ...

Kind of similar to this, I was wondering how to find the last 5
non-blank items in a range (which just say I've called "TheRange")


--
godonnygo
------------------------------------------------------------------------
godonnygo's Profile:

http://www.excelforum.com/member.php...o&userid=37124
View this thread: http://www.excelforum.com/showthread...hreadid=568925




All times are GMT +1. The time now is 10:39 AM.

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