Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Index/match - make blank cells return a blank value. | Excel Worksheet Functions | |||
Excel 2002: Return blank when VLOOKUP on blank cells | Excel Discussion (Misc queries) | |||
Return non-blank cells | Excel Discussion (Misc queries) | |||
Nested IF - return a blank when compared cells are blank | New Users to Excel | |||
Return All Non-Blank Cells | Excel Worksheet Functions |