Creating a macro for all future spreadsheets

E

epicman

I have created a macro however it will only work within that
spreadsheet. How can i write a macro so that all of my documents
(existing and new) can use this macro.

I then wish to assign a button on the toolbar that uses that macro.
 
D

Dave F

Store the macro in your personal.xls file. This allows you to use the macro
whenever you have Excel open.
 
D

Dave Peterson

I like to work against the activesheet in my code. (Don't use sheet names if
you want it to work for every worksheet.)

Then put the code into a workbook that opens each time excel opens--lots of
people use Personal.xls in their XLStart folder.

And have this workbook build the toolbar modifications when it opens:

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)
 
Top