I created a UDF to analyze a character string (credit card number) and calculate whether or not it is a valid card number (called a Mod test). When I use the UDF in excel, it runs just fine! (yay...) The UDF is a boolean, so it just passes back true/false
at the end of the calculation.
I'm trying to figure out if/how I can use the UDF as a custom data validation rule, so that I can set up validation on a range of cells within a spreadsheet.
I've tried to use the rule =UDF(F9)=TRUE, and various permutations, but the farthest I get is an error message that says "A named range you specified cannot be found." If I omit the initial equals sign, I don't get the error message but everything comes back
as False, including strings that I know are valid. So, it's just not running.
Funny that it runs when I call the function from a cell formula but I can't get it to work within the data validation feature.
Any suggestions?
Thanks!