View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Data Validation - Allow numbers, comma, - and space

Try this play ..

In Sheet1,
List in say, E1:E13 the 13 allowed characters: 0-9, comma, hyphen, space
Then define a range: MyR =Sheet1!$E$1:$E$13

To effect the validation
Assume data entry in A1 down
Select col A (A1 active)
Click DataValidation
Allow: Custom
Formula: =SUMPRODUCT(--(ISNUMBER(SEARCH(MyR,A1))))0
Click OK

Test it out ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
...
Hello

I am trying to have data validation for a cell which only allows users
to enter numbers [0-9] , comma (,) , hyphen (-) and space. User should
be able to enter a combination of these characters.

For Eg: 3, 45-60

I have used this formula
=OR(F8=" ",F8="-",F8=",",F8="0",F8="1",F8="2").

But the problem with this is it allows as long as user enters any one
of these character, if they enter multiple it doesn’t allows them to.

Can anyone help me please?