View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lee Wold[_2_] Lee Wold[_2_] is offline
external usenet poster
 
Posts: 3
Default Function to validate entries in a defined range

I want to create a function that tests a range of cells stated to ensure
that the cells contain only valid data entries - lets call the function
ValidateEntry.

For my purposes valid data is any cell in the range whose value is either:-

1) Null (Blank or empty)
2) "X" (the letter X)
3) Begins with the letters "DC" and is immediately followed by 2 digits e.g
DC09
4) Begins with the letters "SC" and is immediately followed by 2 digits e.g
SC25


e.g ValidateEntry(A5:Z5) would return a "true" statues if all cells within
that range met the criteria above, if not then it would return a "false"
answer (I.e boolean argument).

I want to then use this function in an If statement
e.g If(ValidateEntry(A5:Z5),"Hooray!","Ooops!")

Sorry - still learning!!!