Wednesday, February 15, 2017

Creating User Defined Functions in Excel


  It's possible to extend the functionality of an Excel "mathcad" by creating user defined functions. One can do this using Visual Basic for Applications (VBA) and then use the newly defined function as one would the standard functions available for use with Excel. I was able to create a function, cubic_eqn(coefficients,x) that would evaluate a cubic equation given its coefficients and a given x value.


The user defined function can be accessed using Insert Function.


Don't forget to save your VBA project.

No comments: