View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Return Address of Blank Cells in MsgBox

One way:

Option Explicit
Sub testme()
Dim myStr As String
Dim myRng As Range
Dim myCell As Range

With ActiveSheet
Set myRng = .Range("t10:t25")
End With

myStr = ""
For Each myCell In myRng.Cells
If IsEmpty(myCell) Then
myStr = myStr & ", " & myCell.Address(0, 0)
End If
Next myCell

If Len(myStr) 0 Then
myStr = Mid(myStr, 3)
Else
myStr = "No blanks!"
End If

MsgBox myStr

End Sub



Sandy wrote:

Hello -

I have cells T10:T25. I need to return the address in a MsgBox if the cell
is empty; e.g., say T11 and T15 are empty, in the messagebox it would refer
specifically to T11 and T15.

Any suggestions are greatly appreciated!
--
Sandy


--

Dave Peterson