Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A logical test in the If function for blank, i.e., If blank? | Excel Worksheet Functions | |||
Need to test for a blank worksheet. | Excel Programming | |||
Range or test for blank? | Excel Programming | |||
Macro code to test for blank row and insert blank row if false | Excel Programming | |||
Test for blank lines | Excel Programming |