How do I restrict entry into a cell to only alpha/numeric?

G

Guest

How do I restrict entry into a cell to only alpha/numeric? I don't want
characters. Or maybe just limited characters like -.
 
G

Guest

Apply this formula in Data/Validation/Custom and adjust it to your
requirements as far as upper and lower case and additional characters are
concerned:

=OR(AND(CODE(B3)>=65,CODE(B3)<=90),AND(CODE(B3)>=97,CODE(B3)<=122),AND(CODE(B3)>=48,CODE(B3)<=57))


Regards,
Stefi

„SusanMurray†ezt írta:
 
G

Guest

I'm already using the data validation on this cell to restrict the length.
Can that be incorporated into this formula too? Also, where can I find
information on adjusting the codes to match my needs?
 
P

Pete_UK

A simple way to determine what characters relate to which codes is to
enter this formula in row 1of a blank column in your sheet:

=CHAR(ROW())

and copy down from row 1 to row 255. You can see the character "0" on
row 48 (which is the CODE referred to above in Stefi's post) and other
number characters appearing in sequence up to row 57. Upper-case A is
65, with Z being 90. Lower-case letters start in row 97 and extend to
row 122.

Hope this helps.

Pete
 

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