Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Checking for non blank cells in named range

I have a range, let's call it myRange that's cells B22:B24 in my worksheet.
I need to check that these cells are all not blank before doing something
else. I'm not sure how to write the code to check that all are non-blank.
Any suggestions?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Checking for non blank cells in named range

Here you go

Sub FindBlank()
Dim MyRange, mcell As Range
'Set your range to whatever you want
Set MyRange = Range("B22:B24")
For Each mcell In MyRange
If mcell.Value = Empty Then
MsgBox "You have blank cells in Range - " _
& MyRange.Address(False, False)
Exit Sub
End If
Next
MsgBox "You have NO blank cells in Range - " _
& MyRange.Address(False, False)
' the rest of your code here
End Sub


Sandy

Barb Reinhardt wrote:
I have a range, let's call it myRange that's cells B22:B24 in my worksheet.
I need to check that these cells are all not blank before doing something
else. I'm not sure how to write the code to check that all are non-blank.
Any suggestions?

Thanks


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
Ignore blank cells in a named range when using dependent data validation JackyJ Excel Discussion (Misc queries) 2 September 16th 10 01:09 PM
Checking a cell against a named range Memento Excel Worksheet Functions 8 April 7th 07 01:46 PM
Dynamic Named Range with blank cells tjtjjtjt Excel Discussion (Misc queries) 3 October 5th 05 08:10 PM
Blank cells in named range- how to ignore them when making my graph? Help plz! KR Excel Discussion (Misc queries) 0 August 24th 05 02:35 PM
Checking for all blank cells in a range orcolumn. Mikey Excel Programming 1 June 30th 05 03:59 PM


All times are GMT +1. The time now is 11:35 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"