![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
I have a macro that generates a few charts, and i would like to have the macro automatically include this code with each of those new chart sheets. How can I do this? The code to include is:
Private Sub Chart_BeforeDoubleClick(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean) Sheets("Sales Reports").Select End Sub |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi jrnyman
Easiest way is to save the Sheet with the code as a Template. Simple and very effective! |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
That's a really good idea. Is there anyway to have my macro refer to a specific template when creating new sheets, or do I have to insert the code into the standard WorkSheet template?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|