View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default How to find next empty cell within a column?

If you have a formula in the cell, then the cell is not empty.

If you're looking for the next cell that looks empty, maybe just looking down
that column...

Option Explicit
Sub testme()

Dim myCell As Range
Dim NextEmpty As Range

Set myCell = ActiveSheet.Range("a1")
Do
If myCell.Value = "" Then
Set NextEmpty = myCell
Exit Do
Else
Set myCell = myCell.Offset(1, 0)
End If
Loop

MsgBox NextEmpty.Address

End Sub

If the starting cell looks blank, then that'll be the nextcell. If you want it
to always be under the starting cell, change this line:

Set myCell = ActiveSheet.Range("a1")
to
Set myCell = ActiveSheet.Range("a1").offset(1,0)



Rick wrote:

I need a formula that will find the next empty cell within a column. There is
a formula in that cell but no data. The formula is the same through out the
column. What do you suggest?
--
Rick Rack


--

Dave Peterson