View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Macro display Msgbox when cells are empty

hi
play around with something like this....
Sub countrange()
Dim cnt As Long
Dim cell As Range

cnt = 0
For Each cell In Selection ' change selection to your range
If IsEmpty(cell) Then
cnt = cnt + 1
End If
Next
MsgBox ("there are " & cnt & " empty cells in the range")
End Sub

regards
FSt1
"jackie" wrote:

Hi- I want to create a macro that will display a message box when cells are
empty. For example, lets say use cell range F15:G17. If any of these cells
are empty, I want the message box to pop up. Thanks.