Hi all
I have written a UDF formula called FindPrecedents that uses range.precedents.row in the code (range in this case being the target cell of the formula).
When I use this formula within a sub routine, it works fine. But when I enter into a cell, it returns the wrong value.
After testing, the problem seems to lie with the .precedents.row property, which for some reason does not return the correct value (it merely returns the .row value of the target cell, not the target's precedent(s).
But to reiterate, the exact same code, with the exact same target cell, works fine if called in a sub routine, the probelm is only when the formula is entered into a worksheet cell!
NB This is in Excel 2010
Can anyone help at all?!