Office tutorials

VBA Add-ons – Creating Add-ons in Excel

How do you write an Excel add-in in VBA?

Creating a simple add-on in VBA Excel is primarily about writing a good VBA macro code. In this chapter you will learn how to install such a macro as an Excel add-in. The add-on will consist of two macros:

  • Macro 1 – opening the file saving window and inserting the current date in the file name
  • Macro 2 – generating an example data table from the chapter on the loop Do Loop VBA

Below is a window with ready-made codes of both macros. Copy them to the module in a new Excel file. Save everything as an Excel add-in (.xlam) . When writing to xlam, you should automatically suggest a folder for storing Excel extras. The most common is in this location: C: \ Users \ YOUR_LOGIN \ AppData \ Roaming \ Microsoft \ Extras. Specify the name of the additive as  my_add.xlam .

 

Installing your own VBA add-in to Excel

To install your own Excel add-in, go to the Developer tab . Under the Excel Add-ons icon you can choose your add-on as per the screenshot below. Check my_address and click OK.

We install the VBA Excel add-ons in the tabs in the Excel menu. Go to File> Options> Customize the ribbon. Now we should do the following:

  • On the left, set “Selecting a command from” to Macro
  • On the right side, create a new tab and automatically a new group
  • Move your 2 macros on the left to the new group on the right
  • On the right, change the names of your macros by clicking the right button> Rename.
  • By changing the name, set the icons for your macros
  • Also change the names for the group and cards to be more friendly
  • Move your add-on down the tabs to display at the end of the cards
  • Finished !!!

Now you can use your own Excel extras.

Leave a Reply

Your email address will not be published.