Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sally
 
Posts: n/a
Default Msgbox experts please reply..

hi..
Is it possible to have A msgbox that referes to all blank cells in a
sellected range ? something like : "the cell(s) A1,B9,F12,... are
blank."
How can I refer to a probable blank cell range in the msgbox ?
please help..

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default Msgbox experts please reply..

I am not an expert, but look at this small macro:

Sub Macro1()
Dim r As Range
Dim rr As Range
For Each r In Selection
If IsEmpty(r.Value) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
MsgBox ("empty cells: " & rr.Address)
End Sub

It looks thru Selection for empty cells and builds a range of them.
It then displays the address associated with that range.

--
Gary's Student


"sally" wrote:

hi..
Is it possible to have A msgbox that referes to all blank cells in a
sellected range ? something like : "the cell(s) A1,B9,F12,... are
blank."
How can I refer to a probable blank cell range in the msgbox ?
please help..


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Msgbox experts please reply..

msgbox "The cells " &
activesheet.usedrange.specialcells(xlcelltypeblank s).address & " are all
blank


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"sally" wrote in message
oups.com...
hi..
Is it possible to have A msgbox that referes to all blank cells in a
sellected range ? something like : "the cell(s) A1,B9,F12,... are
blank."
How can I refer to a probable blank cell range in the msgbox ?
please help..



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Msgbox experts please reply..

On 20 Apr 2006 09:52:47 -0700, "sally" wrote:

hi..
Is it possible to have A msgbox that referes to all blank cells in a
sellected range ? something like : "the cell(s) A1,B9,F12,... are
blank."
How can I refer to a probable blank cell range in the msgbox ?
please help..


If it's just a question of referring to that text in a message box
then

MsgBox "the cell(s) A1,B9,F12,... are blank."

will do it.

However if you want to identify the names of specific blank cells,
then you'd need to write the cell addresses to a string variable
Name the Range of cells you're interested in, say A1:F12, as "MyRange"
Then run the following macro.

The limitation is on the length of the string variable you build up,
which I guess is 256 characters. If that's likely to be the case, then
another solution is required, - probably more string variables which
are concatenated for the message box.


Sub IDBlankCell()
Dim stBlankCell As String
Dim rMyCell As Range

For Each rMyCell In Range("MyRange")
If rMyCell = "" Then stBlankCell = stBlankCell &
rMyCell.Address(RowAbsolute:=False, CcolumnAbsolute:=False) & ";"

Next

MsgBox "The cells " & stBlankCell & " are blank."

End Sub


HTH
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Msgbox experts please reply..

On Thu, 20 Apr 2006 18:11:59 +0100, "Bob Phillips"
wrote:

msgbox "The cells " &
activesheet.usedrange.specialcells(xlcelltypeblan ks).address & " are all
blank


Brilliant Bob.

Why can I never see the simple answer, and overcomplicate things.

Rgds

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sally
 
Posts: n/a
Default Msgbox experts please reply..

Thanks Gary's Student
You are an expert..

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sally
 
Posts: n/a
Default Msgbox experts please reply..

Thanks a lot Bob
It's amazing how some combinations can save us time and effort
Thanks again

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sally
 
Posts: n/a
Default Msgbox experts please reply..

Thanks Richard
The great thing about your sub is the "absolute" parts. They somehow
get rid of $ signs in the msgbox.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Msgbox experts please reply..

MsgBox "The cells " & _
ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlank s).Address(False,
False) & _
" are all blank"


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"sally" wrote in message
ps.com...
Thanks Richard
The great thing about your sub is the "absolute" parts. They somehow
get rid of $ signs in the msgbox.



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
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
MsgBox compile error in Excell Jerry Dyben Excel Discussion (Misc queries) 1 October 11th 05 07:04 PM
To Bob(regarding drop downs)- Pls reply Dharsh Excel Discussion (Misc queries) 2 April 28th 05 01:15 PM
Msgbox Wildman Excel Worksheet Functions 1 April 26th 05 04:57 AM


All times are GMT +1. The time now is 11:55 PM.

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"