#1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Next Emptycell row #

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Next Emptycell row #

If there are no empty rows interspered in the data

=CountA($C$6:$C$20)+6 will give next empty row

or if there are embedded blanks

=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($A 1))

Entered with Ctrl+Shift+Enter

HTH

"dan" wrote:

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Next Emptycell row #

Thank you, Toppers
My data are interspersed and contain blank cells which are not empty (cells
contains apostrophe).
The array formula "=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($ A1))"
works good for blanks.
Do you have one for empty cells.

"Toppers" wrote in message
...
If there are no empty rows interspered in the data

=CountA($C$6:$C$20)+6 will give next empty row

or if there are embedded blanks

=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($A 1))

Entered with Ctrl+Shift+Enter

HTH

"dan" wrote:

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. Thanks





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Next Emptycell row #

Dan,

Try:
=SMALL(IF(ISBLANK($C$6:$C$20),ROW($A$6:$A$20),""), ROW($A1))

"dan" wrote:

Thank you, Toppers
My data are interspersed and contain blank cells which are not empty (cells
contains apostrophe).
The array formula "=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($ A1))"
works good for blanks.
Do you have one for empty cells.

"Toppers" wrote in message
...
If there are no empty rows interspered in the data

=CountA($C$6:$C$20)+6 will give next empty row

or if there are embedded blanks

=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($A 1))

Entered with Ctrl+Shift+Enter

HTH

"dan" wrote:

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. Thanks






  #5   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Next Emptycell row #

This is it!
Thanks a lot.

"Toppers" wrote in message
...
Dan,

Try:
=SMALL(IF(ISBLANK($C$6:$C$20),ROW($A$6:$A$20),""), ROW($A1))

"dan" wrote:

Thank you, Toppers
My data are interspersed and contain blank cells which are not empty
(cells
contains apostrophe).
The array formula "=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($ A1))"
works good for blanks.
Do you have one for empty cells.

"Toppers" wrote in message
...
If there are no empty rows interspered in the data

=CountA($C$6:$C$20)+6 will give next empty row

or if there are embedded blanks

=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($A 1))

Entered with Ctrl+Shift+Enter

HTH

"dan" wrote:

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. Thanks










  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Next Emptycell row #

Glad it's OK and thanks for the feedback.

"dan" wrote:

This is it!
Thanks a lot.

"Toppers" wrote in message
...
Dan,

Try:
=SMALL(IF(ISBLANK($C$6:$C$20),ROW($A$6:$A$20),""), ROW($A1))

"dan" wrote:

Thank you, Toppers
My data are interspersed and contain blank cells which are not empty
(cells
contains apostrophe).
The array formula "=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($ A1))"
works good for blanks.
Do you have one for empty cells.

"Toppers" wrote in message
...
If there are no empty rows interspered in the data

=CountA($C$6:$C$20)+6 will give next empty row

or if there are embedded blanks

=SMALL(IF($C$6:$C$20="",ROW($A$6:$A$20),""),ROW($A 1))

Entered with Ctrl+Shift+Enter

HTH

"dan" wrote:

Is there a simplified vba code for the following routine?

Sub test()
Dim row, NextRow As Long
For row = 6 To 20
If IsEmpty(Cells(row, "C")) Then Cells(1, "C") = row: Exit Sub
Next row
End Sub

And a formula if possible. 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
If(a=3;1;emptycell)??? wim rademakers Excel Discussion (Misc queries) 2 January 5th 06 10:23 AM


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

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

About Us

"It's about Microsoft Excel"