Auto insert macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the 'Output to' feature in Access to generate an Excel sheet.

I have written a macro that I manually have to insert to the VBA editor
and execute to format the newly created Excel sheet.

Is there a way to automate the macro insert/run function in the newly
created Excel sheet?

Thanks for your help on this.
 
Don't bother to insert the macro. Just include the macro in you personal.xls
file and it should be available whenever you open Excel
 
Thanks Gary,

I am new at this macro stuff.
What is personal.xls? Where does it reside?
Thanks for your assisstance.
 
Hi Gary,

I did a web search on "personal.xls" and I think I found the info
I was looking for. Thanks for pointing me in the right direction.
 
CityGuy

You can save it in your Personal Macro Workbook......Personal.xls

or in any new workbook which you then save as an Add-in.

If you don't have a Personal.xls you can create one..........

With an existing workbook open..........

Tools>Macro>Record New Macro. Store in Personal Macro Workbook.

Record some simple steps like copying a cell and pasting it.

Hit the Stop Recording button.

You now have a Personal.xls workbook.

Hit ALT + F11 to go to the Visual Basic Editor.

CTRL + r to open project explorer.

Find Personal.xls and double-click on Module1.

Copy/paste your macro into that module.

Save Personal.xls.

Note: it can be saved Hidden so it is always available but not seen.


Gord Dibben MS Excel MVP
 

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

Back
Top