Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Return Address of Blank Cells in MsgBox

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Return Address of Blank Cells in MsgBox

Maybe:

Dim msg As String
msg = "Blank cells found:" & Chr(10)
On Error Resume Next
msg = msg & Range("T11:T25").SpecialCells(xlCellTypeBlanks).Ad dress
On Error GoTo 0
MsgBox msg


Hope this helps
Rowan

"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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Return Address of Blank Cells in MsgBox

Thanks, Rowan and Dave!

Both solutions worked!
--
Sandy


"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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Return Address of Blank Cells in MsgBox

I like Rowan's better!

Sandy wrote:

Thanks, Rowan and Dave!

Both solutions worked!
--
Sandy

"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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
Excel 2002: Return blank when VLOOKUP on blank cells Mr. Low Excel Discussion (Misc queries) 2 June 4th 09 05:12 PM
Return non-blank cells Gene Excel Discussion (Misc queries) 6 May 27th 09 10:46 PM
Nested IF - return a blank when compared cells are blank Struggling in Sheffield[_2_] New Users to Excel 2 February 9th 09 08:14 PM
Return All Non-Blank Cells shorticake Excel Worksheet Functions 6 October 1st 07 09:29 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"