Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
rog rog is offline
external usenet poster
 
Posts: 3
Default first blank i a column

Hi, I need a routine to search for the first blank cell in a column.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default first blank i a column

Rog,

This gives you the row of the first blank

=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

change the column and number of rows to suit

it's an array formula, so enter with Ctrl-Shift-Enter. To get the cell, just
precede with your column letter, A in my example
=A&=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"rog" wrote in message
...
Hi, I need a routine to search for the first blank cell in a column.
Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
rog rog is offline
external usenet poster
 
Posts: 3
Default first blank i a column

Thanks Bob, but how to do it in VBA?

"Bob Phillips" wrote in message
...
Rog,

This gives you the row of the first blank

=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

change the column and number of rows to suit

it's an array formula, so enter with Ctrl-Shift-Enter. To get the cell,

just
precede with your column letter, A in my example
=A&=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"rog" wrote in message
...
Hi, I need a routine to search for the first blank cell in a column.
Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default first blank i a column

Rog,

You could use that formula, or you could just loop through looking for an
empty cell

For i =1 to Cells(Rows.Count,"A").End(xlUp).Row
if IsEmpty(Cells(i,"A").Value) Then
'i is the row
Exit For
End If
Next

This will pass over a formula that returns an empty cell, so if you want to
find that one, use

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "A").Value = "" Then
'i is the row
Exit For
End If
Next

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"rog" wrote in message
...
Thanks Bob, but how to do it in VBA?

"Bob Phillips" wrote in message
...
Rog,

This gives you the row of the first blank

=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

change the column and number of rows to suit

it's an array formula, so enter with Ctrl-Shift-Enter. To get the cell,

just
precede with your column letter, A in my example
=A&=MIN(IF(ISBLANK(A1:A1000),ROW(1:1000)))

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"rog" wrote in message
...
Hi, I need a routine to search for the first blank cell in a column.
Thanks








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Sum a column if reference column is blank Rusty Excel Worksheet Functions 2 January 15th 10 09:24 PM
insert a blank column between each column in a data file Holly Excel Discussion (Misc queries) 1 October 31st 07 07:04 PM
SUM values in this column F only if cell is blank in column Q...HE Lisa Excel Discussion (Misc queries) 3 March 1st 07 03:22 PM
How do I count the items in one column if another column is blank dereksmom Excel Worksheet Functions 1 November 8th 06 11:34 PM
Warning message if one column contains any text and another column is blank Dileep Chandran Excel Worksheet Functions 12 October 30th 06 07:50 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"