Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Test For BLANK Range

I need to write an IFTHENELSE statement that will look at a range to
determine if it is blank or not. If it is blank I need to throw a messagebox.
If not, I need to continue.

My problem is that I can see how to do this with a formula in a sheet, but
don't want the results (or the formula for that matter) to appear on my
worksheet.

Any help is appreciated!

Thanks,
Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Test For BLANK Range

It depends on "how" blank:

Sub blanket()
MsgBox (Application.WorksheetFunction.CountA(Selection))
End Sub

will return zero if the cells Selected are empty. It will return 1 if one
of the cells contains something like:
=""
--
Gary''s Student - gsnu200742


"RayportingMonkey" wrote:

I need to write an IFTHENELSE statement that will look at a range to
determine if it is blank or not. If it is blank I need to throw a messagebox.
If not, I need to continue.

My problem is that I can see how to do this with a formula in a sheet, but
don't want the results (or the formula for that matter) to appear on my
worksheet.

Any help is appreciated!

Thanks,
Ray

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Test For BLANK Range

Actually, it seems to return a 1 no matter what...

"Gary''s Student" wrote:

It depends on "how" blank:

Sub blanket()
MsgBox (Application.WorksheetFunction.CountA(Selection))
End Sub

will return zero if the cells Selected are empty. It will return 1 if one
of the cells contains something like:
=""
--
Gary''s Student - gsnu200742


"RayportingMonkey" wrote:

I need to write an IFTHENELSE statement that will look at a range to
determine if it is blank or not. If it is blank I need to throw a messagebox.
If not, I need to continue.

My problem is that I can see how to do this with a formula in a sheet, but
don't want the results (or the formula for that matter) to appear on my
worksheet.

Any help is appreciated!

Thanks,
Ray

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Test For BLANK Range

Try it on a fresh blank worksheet. It should give 0 for any Select'ed block
of cells
--
Gary''s Student - gsnu200742


"RayportingMonkey" wrote:

Actually, it seems to return a 1 no matter what...

"Gary''s Student" wrote:

It depends on "how" blank:

Sub blanket()
MsgBox (Application.WorksheetFunction.CountA(Selection))
End Sub

will return zero if the cells Selected are empty. It will return 1 if one
of the cells contains something like:
=""
--
Gary''s Student - gsnu200742


"RayportingMonkey" wrote:

I need to write an IFTHENELSE statement that will look at a range to
determine if it is blank or not. If it is blank I need to throw a messagebox.
If not, I need to continue.

My problem is that I can see how to do this with a formula in a sheet, but
don't want the results (or the formula for that matter) to appear on my
worksheet.

Any help is appreciated!

Thanks,
Ray

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
A logical test in the If function for blank, i.e., If blank? egii Excel Worksheet Functions 5 September 16th 09 11:46 AM
Need to test for a blank worksheet. Greg Glynn Excel Programming 1 July 20th 06 12:34 PM
Range or test for blank? davegb Excel Programming 4 May 8th 06 05:59 PM
Macro code to test for blank row and insert blank row if false Mattie Excel Programming 2 March 29th 06 01:19 AM
Test for blank lines MarkN Excel Programming 2 February 1st 06 02:20 AM


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