Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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"



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default checking a Cells contents


uh..., len(a) = 9..., of course.


"Bob Kilmer" wrote in message
...
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"





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default checking a Cells contents

Cheers Guy's plenty of food for thought there, I have absoultly no idea what
some of those formula's are doing but give me time to dissect it all and I
may get it!!

Thanks for all your responses cheers ant

PS sorry it was supposed to be 10 characters my fault for only putting 9
first time round
ie 12A1234567 oops!!


uh..., len(a) = 9..., of course.


"Bob Kilmer" wrote in message
...
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"






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
Checking the length of cell contents RichardG Excel Discussion (Misc queries) 8 February 21st 06 12:37 PM
checking a Cells contents Dave Peterson[_3_] Excel Programming 1 September 9th 04 01:04 PM
checking a Cells contents Bob Kilmer Excel Programming 0 September 9th 04 03:02 AM
Checking contents Edgar Thoemmes Excel Programming 4 February 9th 04 02:01 AM
Checking contents Edgar Thoemmes[_2_] Excel Programming 5 February 3rd 04 02:56 PM


All times are GMT +1. The time now is 06:18 AM.

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

About Us

"It's about Microsoft Excel"