use one macro in different excel files

前端 未结 5 1641
我寻月下人不归
我寻月下人不归 2021-02-03 15:23

I wrote a macro, which I would like to use in different excel files, which have almost the same table structure but different data.

So is it possible anyhow just to \"in

5条回答
  •  不思量自难忘°
    2021-02-03 16:09

    You have two options; you can

    1) include your macro in your personal.xlsb, which will be hidden, yet available for your use or

    2) include your macro in an add-in file which will startup with excel every time. Add-in files give you the added benefit of easy distribution if someone else would like to use your macro(s).

    For the tool I'm building, I chose to use an add-in file and it's worked out great.

    Put your code in a module in the addin, make sure the macro is not private, and you can even make a button for easy use on your quick-access-toolbar.

    Problem solved.

提交回复
热议问题