Running VBA routines from a new workbook

Newton Excel Bach, not (just) an Excel Blog

I have had a couple of queries recently which seem to be resulting from trying to run User Defined Functions (UDFs) from a new workbook, so this post will look at the options for using the VBA routines provided here (or anywhere else) with new data.

VBA routines come in two basic types:

  • UDFs, which work in a similar way to the built-in Excel functions.  The function name is entered along with the required arguments, and it displays the results, either a single value or a range of values.
  • Macros, which perform a series of operations, either predefined, or with interaction from the user.  Macros are initiated either by clicking on a button (or other object), or through a custom menu or icon on  a tool bar or ribbon, or by selecting from a list (press Alt-F8, or click Macros on the Developer Ribbon).

In both cases all the VBA code…

View original post 267 more words