User defined functions writen in Excel VBA seem to run much slower than functions simply written in the worksheet cells. Is there a way to run them faster? As an example I have a very simple user defined function:
Function myweekday(mydate As Double)
myweekday = Weekday(mydate)
End Function
Basically it does the same thing as the built in =weekday() function. However running this on 50,000 cells takes about 5 seconds to calculate, whereas simply using the built in function takes a fraction of a second.
What can I do to make user defined functions like this run faster?
