ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Creating a macro for all future spreadsheets (https://www.excelbanter.com/excel-discussion-misc-queries/107927-creating-macro-all-future-spreadsheets.html)

epicman

Creating a macro for all future spreadsheets
 
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.


Dave F

Creating a macro for all future spreadsheets
 
Store the macro in your personal.xls file. This allows you to use the macro
whenever you have Excel open.

--
Brevity is the soul of wit.


"epicman" wrote:

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.



Dave Peterson

Creating a macro for all future spreadsheets
 
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)


epicman wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com