Not really.
But if I needed this, I wouldn't want the code duplicated in tons of other
workbooks. Instead, I think I'd create an addin that added a button to a
toolbar (even a new toolbar). Then I could use this single addin whenever I
wanted to do that analysis.
I'm not sure what your code does, but you may have to generalize it a bit--use
ActiveSheet instead of a specific worksheet name--activeworkbook instead of the
name of the workbook--pivottable(1) instead of a particular name.
=========
You may want to look at how Debra Dalgleish approached this with her pivottable
addin.
http://www.contextures.com/xlPivotAddIn.html
and
http://www.contextures.com/xlPivotAddIn02.html
=========
Saved from a previous post:
Your life will become much simpler if you include code to create the toolbar
when the workbook is opened and include code to destroy the toolbar when the
workbook is closed.
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)
In xl2007, those toolbars and menu modifications will show up under the addins.
And if you use xl2007:
If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm