I'm trying to write a function that can be used on the worksheet and from vba, and I'm coming up with a problem.
In the attached workbook there are formulae in cells C5 and C6 containing calls to the UDF GetRowNo.
These work fine and show the row number of the date sought in column A (even when the format of cells in column A is different from the format of the date used in cell C6).
In the code module, below the UDF, is a macro called test. As far as I can see it calls the UDF with the same data, yet it does not find the data. Stepping through it with F8 after the Stop instruction and watching the Locals pane, everything seems exactly the same.
Do you people get the same result?
What's the difference?
How do I fix it?
(I'm using Excel 2007 in Compatibility Mode)