Search code examples
vbagenericssavesend

use macro for multiple workbooks


I have created a few macros for a set of actions.

The code are pretty generic since I want to use them for a general purpose (to automatic copy and paste some worksheets within the same workbook).

I wonder what and how to save the macros so that I can send it out to my colleagues and let them use the codes for other workbooks?

Should I save it as a macro enabled workbook and let my colleages import their own worksheets?


Solution

  • 1) You could create add-in in Excel, the file with *.xlam extension. Then you need to sent that file to them. Your colleagues will need to open it to save it as add-in.

    2) You can export your module where your vba code is to *.bas file as presented on the picture below. Than you colleagues need to import it to their files. Right-click on your module in VBE editor to get this menu where you'll find Export and Import options.

    enter image description here

    3) You could simply copy your code and send it by e-mail. Add instruction which way your colleagues will add modules where they paste your code. They could use Personal.xlsb as a destination file for your macros.