View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 156
Default Checking for non blank cells in named range

Here you go

Sub FindBlank()
Dim MyRange, mcell As Range
'Set your range to whatever you want
Set MyRange = Range("B22:B24")
For Each mcell In MyRange
If mcell.Value = Empty Then
MsgBox "You have blank cells in Range - " _
& MyRange.Address(False, False)
Exit Sub
End If
Next
MsgBox "You have NO blank cells in Range - " _
& MyRange.Address(False, False)
' the rest of your code here
End Sub


Sandy

Barb Reinhardt wrote:
I have a range, let's call it myRange that's cells B22:B24 in my worksheet.
I need to check that these cells are all not blank before doing something
else. I'm not sure how to write the code to check that all are non-blank.
Any suggestions?

Thanks