View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer Bob Kilmer is offline
external usenet poster
 
Posts: 280
Default checking a Cells contents

how about:

a = "11X1111111": if len(a) = 10 and mid(a,3,1) like "[A-z]" and
isnumeric(left(a,2)& right(a,7)) Then Cells(2,1) = "valid order" else
Cells(2,1) = "not valid order"

or

a = "11!1111111": Cells(2,1) = iif( len(a) = 10 and mid(a,3,1) like "[A-z]"
and isnumeric(left(a,2)& right(a,7)),"valid order" ,"not valid order")

?

;^)


"antinoz" wrote in message
...
I'm trying to validate data in a column of cells to check that the format

is
"NNANNNNNN" (N= number A= Alpha I have) all the cell contents are

different
but have 9 characters containing the alphanumeric format as shown

I want to put it in an If statement:

so if cell A1 = mask "NNANNNNNNN" cell A2 = "Valid order"