I would like to add some data validation on a cell in the latest Excel. I would like to force the user to enter a string that is two-char long, with the first char a digit, and the second char a letter.
e.g.
1m
2m
9w
8y
How would you do that?
Also, if a lower case letter is entered, i’d like to render it an upper case letter when the input is finished.
Only for the first part (no VBA needed), you can use Data Validation:
A1for instance)Allow:, choose Custom=IF(AND(LEN(A1)=2,ISNUMBER(VALUE(LEFT(A1,1))),ISTEXT(RIGHT(A1,1))),TRUE,FALSE)Btw, you could add a check with an
UPPERCASEtest.[EDIT] Also have a look at brettj’s answer for a similar but optimized solution