View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Finding Empty Cells

If the block of cells is contiguous you can use something similar to the code
below to get a count of blank cells.

Sub BlankCells()

Dim l As Long

Selection.CurrentRegion.Select
Selection.SpecialCells(xlCellTypeBlanks).Select
l = Selection.Cells.Count

If l 0 Then
'Do something here
Else
'Do something here
End If

End Sub

--
Kevin Backmann


"Bill" wrote:

Hello,
I would like to know if a range contains any blank cells. Is there a
shorter method than the one below that simply finds the first occurrence of
an empty cell? Thanks.

Blank = "No"
For Each Cellrge In numtran
If IsEmpty(Cellrge) = True Then
Blank = "Yes"
Exit For
End If
Next Cellrge