Change Ricks' DV formula to
=AND(LEN(K1)=6,ISNUMBER(--LEFT(K1,2)),ISNUMBER(--RIGHT(K1,3)),CODE(MID(K1,3,1))>64,CODE(MID(K1,3,1))<91)--David BiddulphSteve Albert wrote:> In Excel 2007, how would I use this to restrict the cell to 2> numbers, 1 letter, then 3 numbers. For example, 14Q215>> Thanks.>> - Steve>> "Rick Rothstein (MVP - VB)" wrote:>>> Thanks for posting your message... it got me to thinking and,>> actually, as it turns out, my original code and your modification to>> it would never be restrictive enough... insuring a value is not a>> number does not guarantee it is a letter (as opposed to a>> punctuation mark, for example). I have just posted this formula...>>>> =AND(LEN(K1)=4,ISNUMBER(--MID(K1,2,3)),CODE(K1)>64,CODE(K1)<91)>>>> which I believe is restrictive enough, to the OP's message where he>> thanked me... I sure hope he comes back to that sub-thread to read>> it.>>>> Thanks again for your message.>>>> Rick>>>>>> "Jim Cone" <
[email protected]> wrote in message>>