Data Validation

L

LaDdIe

Hi,

I'm trying to apply data validation to a range of cells, the rules are that
the user must enter a numeric value >0, or enter 0, the cell can't just be
left blank.

Any help is welcome.
 
O

Otto Moehrbach

I don't think Data Validation is going to do that. What is the driver that
is going to force the user to do anything? In other words, what do you want
to happen if the user doesn't follow your rules?
An example of what can happen: If the user doesn't follow the rules, and
attempts to close or save the file, a message box will pop up saying
whatever you want it to, and the file will nor close or save. The driver,
in this instance, is that he can't close or save the file if he doesn't
follow your rules. So the question is back to you; what do you want to
happen if the user doesn't follow your rules? HTH Otto
 
M

Martin Brown

LaDdIe said:
Hi,

I'm trying to apply data validation to a range of cells, the rules are that
the user must enter a numeric value >0, or enter 0, the cell can't just be
left blank.

Any help is welcome.

You can set validation to whole number and a specific range, but you
cannot prevent the user pressing return on an empty cell. You would have
to move the test for ISNUMBER() into whatever the next stage is.

NB A blank cell looks to some Excel numeric functions like zero.

Regards,
Martin Brown
 
L

LaDdIe

Thanks Otto,

I guessed as much, I decided to go the VBA route and knocked up some code
that bounce back to the previous cell if that cell was left blank.
 
L

LaDdIe

Thanks Martin

Martin Brown said:
You can set validation to whole number and a specific range, but you
cannot prevent the user pressing return on an empty cell. You would have
to move the test for ISNUMBER() into whatever the next stage is.

NB A blank cell looks to some Excel numeric functions like zero.

Regards,
Martin Brown
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top