View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
David G[_4_] David G[_4_] is offline
external usenet poster
 
Posts: 23
Default Validation based on digits in the middle of a string

On Apr 20, 3:55 pm, TexasStar wrote:
David,

I tried using your code in the data validation part and when I copy
and paste it in and try and hit the "ok" button it gives me an error
message back saying that the forrmula contains an error. I tried to
figure out where the problem is but this seems like a fairly complex
formula and I wans't able to fix the problem. Can you look your
formula over and see if you can figure out where the error is?

I think your method is exactly what I am looking for so it would be
really awesome if I can get this working! Thx for your help with this.
It's greatly appreciated.


Did you change A1 to the address of the cell you are setting up the
validation for?
Did you paste the entire formula (including the = sign)?
Are you using Excel 2003 or higher (I'm not sure if lower versions
support all the functions)?

Here are some debugging steps you could use:
1. Try pasting the formula into a regular cell and see if it displays
TRUE or FALSE.
2. Try breaking up the formula into smaller bits to see if they work
=SEARCH("-???-",A1) // should show the index of the -
###- part for text in A1
=MID(A1,SEARCH("-???-",A1)+1,3) // should extract the
middle portion of the text in A1
=MATCH(MID(A1,SEARCH("-???-",A1)+1,3),validlist,0) //
should print a number if the middle portion is found, or an error if
not

Unfortunately theres only so much I can do without seeing the error
that you're seeing.

David