View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrew[_24_] Andrew[_24_] is offline
external usenet poster
 
Posts: 22
Default Using VBA functions in Worksheet cell data validation

I wish to validate the data in cell B3. I can readily set up a custom
validation using a formula such as =AND(B3=0, B3<=100)

I would like to use a VBA function that I have written called IsValid().
However, if I attempt to enter a custom validation formula of =IsValid(B3)
I receive the message "a named range you specified cannot be found".

Where am I going wrong? Can't I reference a VBA function in this way?

The function appears to work if I use it in a normal Worksheet formula. For
example, if I enter =IsValid(A3) in cell A4 then A4 correctly displays
either TRUE or FALSE depending on the value in A3.