Universal Macros?

A

Andrew

I have a file that I export to excel and I need to constantly reformat the
cells etc. I recorded a Macro for the formatting but everytime I export it
again the macro isnt there. How to I record a macro and make it available to
any document in excel?

Thanks
 
B

Bernard Liengme

Put the macro in PERSONAL.XLS. This hidden file gets opened every time you
start Excel.
Bernard
 
D

Dave Peterson

This doesn't quite sound universal to me. If it were a macro that I wanted
available for all my workbooks, then I'd put it in my personal.xl* workbook.

But for these type things, I put the macro in a separate workbook. I start a
new workbook, I turn on the macro recorder and import the file. I format the
data the way I want and then turn off the recorder.

Then I go back and tweak the code (to get rid of .select's and to make sure the
range addresses aren't hardcoded).

Then I plop a giant button from the forms toolbar onto the only worksheet in
that "macro" workbook. I add some instructions (to remind me what it does) and
then save that workbook.

When I need to import that data, I'll just open that workbook and click the
button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top