I've written a function which takes a range of usually a few thousand cells, puts them in an array, sorts them and finds a particular located cell and returns that value. The sorting takes a moment to complete so the calculation usually takes approx a second.
Then I noticed that automatic calculations, such as when you save, take minutes rather than seconds to recalculate so I decided to put in a MsgBox to tell me when the function is run and for some reason each calculation is being repeated an incredible amount of times! I can't understand why because even doing a Shift+F9 doesn't seem to cause the same amount of recalculating.
Can anybody give me any tips on how to find the cause and possible solutions. It's getting ridiculous waiting so long for the constantly repeating recalculations.
Please help!
For your info I'm using Excel XP and I've switched to Manual Recalculating within the Function just to be sure it's not that.
Then I noticed that automatic calculations, such as when you save, take minutes rather than seconds to recalculate so I decided to put in a MsgBox to tell me when the function is run and for some reason each calculation is being repeated an incredible amount of times! I can't understand why because even doing a Shift+F9 doesn't seem to cause the same amount of recalculating.
Can anybody give me any tips on how to find the cause and possible solutions. It's getting ridiculous waiting so long for the constantly repeating recalculations.
Please help!
For your info I'm using Excel XP and I've switched to Manual Recalculating within the Function just to be sure it's not that.