Data validation problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to set a length constraint for a text cell between 1-30 characters,
the cell cannot be empty. Giving 1 for lower limit in Data validation doesn't
prevent the cell to be empty (that is zero length). Giving 2 for lower limit
does prevent the cell to be 1 char long. Any idea how can I set a constraint:
not empty, min 1 char, max 30 char?
 
Hi
not possible with data validation alone. If you really needs to make sure
that a cell is not left empty before closing the file you'll need vBA code in
the beforesave or beforeclose event
 
Data validation can't prevent a cell from being left empty.

You can use programming to check the cell before the file is closed.

Or, make other key cells dependent on an entry in this cell.
For example: =IF(A2="","Please select a Product Code",E2*F2)
 
Thanks everybody for the quick response. Nevertheless I think it is a weak
point of Excel.
Stefi
 

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

Back
Top