Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default Data Validation - Only Allowing certain characters

Is it possible to use data validation to restrict what characters can be
entered by a user?

E.g.

Restricted characters: A B C D E

So if a user enters "BAD", it will be accepted, however if he/she enters
"CAT" an error msg is shown because the character T is not allowed.

I've tried creating a formula using the Find method, but it doesn't seem to
know what to do. Is there a "Contain" text function in Excel?

Also, I've tried using the Formatting of cells, but it still allows for
entry. My last option will be to use VBA, but I'm trying not to.

Any assistance will be much appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Data Validation - Only Allowing certain characters

You can use a formula of

=SUMPRODUCT(--(ISNUMBER(MATCH(MID(E1,ROW(INDIRECT("1:"&LEN(E1))) ,1),$M$1:$M$5,0))))=LEN(E1)

assuming E1 is the DV cell, and M1:M5 hold the allowable characters.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Marcus" wrote in message
...
Is it possible to use data validation to restrict what characters can be
entered by a user?

E.g.

Restricted characters: A B C D E

So if a user enters "BAD", it will be accepted, however if he/she enters
"CAT" an error msg is shown because the character T is not allowed.

I've tried creating a formula using the Find method, but it doesn't seem
to
know what to do. Is there a "Contain" text function in Excel?

Also, I've tried using the Formatting of cells, but it still allows for
entry. My last option will be to use VBA, but I'm trying not to.

Any assistance will be much appreciated. Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allowing data entry in protected sheets David Excel Discussion (Misc queries) 1 November 7th 06 09:18 PM
Problem with Data Validation and limiting characters MagnoliaSouth Excel Worksheet Functions 2 October 2nd 06 02:52 AM
Allowing data in specific forms Luke Excel Discussion (Misc queries) 15 October 14th 05 11:40 AM
Allowing the Legend Box to display more characters Sam Charts and Charting in Excel 1 July 5th 05 11:53 PM
Allowing Data Entry ONLY??? mthespike Excel Worksheet Functions 1 June 29th 05 08:11 PM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"