ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find 1st Empty Cell: How to? (https://www.excelbanter.com/excel-programming/284178-find-1st-empty-cell-how.html)

Chris

Find 1st Empty Cell: How to?
 
Hello, this has got me stumped. Being fairly new I hope you'll bear with me.
I have selected cellA1:A500 and sorted it so that only filled cells appear
from A1 onwards. However I'm never sure where the filled range will end and
want to store the 1st empty cellname in a variable too shorten my read loop.
But how do I determine the 1st empty cell?

thanks for any help.
Chris



Ron de Bruin

Find 1st Empty Cell: How to?
 
You can use this Chris

Range("A" & Rows.Count).End(xlUp).row
This wis the last cell with a value inn column A

For Myrow = 1 To Range("A" & Rows.Count).End(xlUp).row


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Chris" wrote in message ...
Hello, this has got me stumped. Being fairly new I hope you'll bear with me.
I have selected cellA1:A500 and sorted it so that only filled cells appear
from A1 onwards. However I'm never sure where the filled range will end and
want to store the 1st empty cellname in a variable too shorten my read loop.
But how do I determine the 1st empty cell?

thanks for any help.
Chris





Tom Ogilvy

Find 1st Empty Cell: How to?
 
set rng = Range("A1:A500").Specialcells(xlblanks)(1)


or

set rng = cells(rows.count,1).End(xlup)(2)

--
Regards,
Tom Ogilvy


"Chris" wrote in message
...
Hello, this has got me stumped. Being fairly new I hope you'll bear with

me.
I have selected cellA1:A500 and sorted it so that only filled cells appear
from A1 onwards. However I'm never sure where the filled range will end

and
want to store the 1st empty cellname in a variable too shorten my read

loop.
But how do I determine the 1st empty cell?

thanks for any help.
Chris





Chris

Find 1st Empty Cell: How to?
 
Thanks!
"Ron de Bruin" wrote in message
...
You can use this Chris

Range("A" & Rows.Count).End(xlUp).row
This wis the last cell with a value inn column A

For Myrow = 1 To Range("A" & Rows.Count).End(xlUp).row


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Chris" wrote in message

...
Hello, this has got me stumped. Being fairly new I hope you'll bear with

me.
I have selected cellA1:A500 and sorted it so that only filled cells

appear
from A1 onwards. However I'm never sure where the filled range will end

and
want to store the 1st empty cellname in a variable too shorten my read

loop.
But how do I determine the 1st empty cell?

thanks for any help.
Chris







Chris

Find 1st Empty Cell: How to?
 
U2 Thanks!!
"Tom Ogilvy" wrote in message
...
set rng = Range("A1:A500").Specialcells(xlblanks)(1)


or

set rng = cells(rows.count,1).End(xlup)(2)

--
Regards,
Tom Ogilvy


"Chris" wrote in message
...
Hello, this has got me stumped. Being fairly new I hope you'll bear with

me.
I have selected cellA1:A500 and sorted it so that only filled cells

appear
from A1 onwards. However I'm never sure where the filled range will end

and
want to store the 1st empty cellname in a variable too shorten my read

loop.
But how do I determine the 1st empty cell?

thanks for any help.
Chris








All times are GMT +1. The time now is 03:08 AM.

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