What exactly do you mean by "returns a blank" and "tests for blank
cells" ???
The zero length string (ZLS) [ "" ] is NOT a BLANK (ie, empty) cell.
Worksheet function ISBLANK actually tests for an empty (null) cell.
VBA IsEmpty(variant) (AKA IsEmpty(singleCellRange.Value)) also tests for
an empty (null) cell.
I know of no way for a function to return a BLANK (ie, empty) value.
Best suggestions I have for you is to revise your model to include a
visual value [ n/a, ---, or whatever ] that can be included in yourvalidationlist, and returned by your formula.
HTH ... good luck!
--
Clif McIrvin
(clare reads his mail with moe, nomail feeds the bit bucket
Thank you all for the replies. "ignoreblanks" works as Garry
describes. It allows you to enter a blank without getting a datavalidationerror, even thoughtblanksare not on thevalidationlist.
I am not sure Wouter has it quite right. I can enter a formula after
the datavalidationis turned on, and the datavalidationworks fine
on the formula unless the formula returns a blank. For example, if I
want integers between 0 and 100 and the formula returns a value
between 0 and 100 then I do not get avalidationerror. If it returns
any value other than 0-100 then I do get an error. This issue is that
I do not want to get avalidationerror if the formula returns a
blank.
I cannot have the formula return "0" when the value is missing since
missing values are to be treated differently than 0.
Finally, obviously I can place my formulas somewhere else and copy-
past-values back into the right cells, but this is cumbersome. Clearly
there are workarounds, but the issue is that I have a lot of VBA that
interpretsblanksin a certain way, and a lot of data validations on
the cells, and when I try to fill the cells with formulas this
produces all the datavalidationerrors.
Since the datavalidationworks fine for formulas in all circumstances
except when they return a blank, I am thinking this is a microsoft
bug... unless there is some alternative way to have a formula return a
blank that gets interpreted by the datavalidationas a blank, I am
stuck with the inelegant work-arounds.
Thanks again for the help.
...Rick
After serious thinking Gord Dibben wrote :
The behavior I get when "IgnoreBlanks" IS checked is that I can leave
the cell empty OR empty the cell if I type an invalid entry, without
getting an alert.
If I uncheck "IgnoreBlanks", I get an alert if I try to empty the
cell
after making an entry.
If I use a named range withblanks, theblanksappear in the dropdown.
Free usenet access athttp://
www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc