I am always curious how some of the functions I use in excel were written, and think it would help at times to see how it was done.

Does anyone know where there is example vba that replicates what some of these functions do? vlookup, hlookup, dsum, index, actually any or most would be interesting.

link|improve this question

73% accept rate
1  
They are likely to be written in C not VBA – Mark Jun 12 '10 at 21:35
feedback

1 Answer

In Chapter 10 of Microsoft Excel 2000 Power Programming with VBA, Walkenbach writes a VBA function to emulate SUM. I presume it's in later versions too, but I don't own them. The exercise is intended to demonstrate the complexity of the built-in functions and to teach some defensive programming techniques.

I haven't seen this done on the web or with any other Excel functions. But it would be interesting.

link|improve this answer
That is exactly what I was hoping to find somewhere. Thanks much.+1 – datatoo Jun 14 '10 at 15:08
Note this is writing the equivalent and not necessarily how MS did it. – Mark Jun 15 '10 at 12:39
I understand. It is enlightening to see how others write UDF and I was hoping there was a site that showed examples. It would be nice to find how MS did it, but I would settle for others as well. Thanks – datatoo Jun 21 '10 at 15:35
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.