0

I want to create a macro and save it in a way so that it would be used by any Excel workbook I open on my computer. Is there a way to do this?

7
  • Any spreadsheet? Like different versions of Excel? Like outside of excel to Google, LibreOffice, Openoffice, Corel WP? You are not being very clear here.
    – mdpc
    Dec 28, 2014 at 9:13
  • 1
    @mdpc it's tagged with Excel, so I think you can ignore any spreadsheet system that is not Excel, no?
    – teylyn
    Dec 28, 2014 at 9:14
  • Any version of Excel?
    – mdpc
    Dec 28, 2014 at 9:15
  • Tony, do us a favour and put a few more words into your question, so it is clear that you want the macros to run in any Excel file. State your version. It would be ridiculous to close a question as "unclear" that has an accepted answer.
    – teylyn
    Dec 29, 2014 at 22:35
  • @teylyn Yes it's ridiculous. It will be more ridiculous if the hold doesn't get removed after my edits. I don't know if those 5 people will get notified about the edits and I am not going to put any effort telling them. The system should do this. I already voted to reopen. Dec 30, 2014 at 0:50

1 Answer 1

3

You can save a macro in your Personal.xls (or .xlsb, depending on your version). Any macro in that file will be available in any workbook you open on that computer.

The easiest way to access your Personal.xlsb is to start recording a new macro. The first step, where you set a name for the new macro will prompt you where to save the macro.

enter image description here

Select "Personal Macro Workbook" and record a dummy macro. Now your Personal.xlsb is established and will show up whenever you open the VBE and you can add your favourite functions and subs.

3
  • @Twisty Without changing the extension, the Personal workbook has xlsb on my system using XL 2013 on Win 8.1 and on the other machine with 2010 and Win 7.
    – teylyn
    Dec 29, 2014 at 2:13
  • 1
    @Twisty I can't believe you're asking this. That's what the flipping file is for. But for the record: Yep. It does contain macros/VBA. BTW, try googling for personal.xlsm. You'll find that Google serves results for personal.xlsb instead. Coz that's what Excel uses.
    – teylyn
    Dec 29, 2014 at 8:33
  • No offense intended. You are correct. I was not thinking clearly on a post made much too late at night. Dec 29, 2014 at 11:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .