Hi, I’m using Excel 2007 and I have a UDF which calculates the total of the largest x number of values in a range.
I.e. in the range 1 2 3 4 5 6 7 8 9 10 where x is 2 the result would be 19 (9 + 10).
The function works but does not update (or more accurately throws a #VALUE error) when either the range value or value of x is changed - if I force a recalculation the values update correctly.
My code is as follows:
valrange is the range of values from which I wish to extract the largest values
discs is the number of relevant values (x in my example)
I'd really appreciate any suggestions as to how I can make this recalculate automatically!![]()
Please Login or Register to view this content.
Thanks
All done, sorry about that!
Bookmarks