Automatically inserting macro into new sheets

snowboy001

Board Regular
Joined
Dec 5, 2009
Messages
100
I am working on a sheet that has code put in each worksheet for change tracking. This is something that many other people are going to be using, and I would really like to make it as "idiot-proof" as possible. Is there any way that each time a new sheet is inserted, the code for the worksheets is automatically entered? It is the same code for each sheet, so there is no worry about changes to any of the format.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
hi,
Once we write a macro for the workbook i automatically works for inserted sheet and also the new workbook saved opened after opening a workbook contaning macro.press ALT F8 when box opens containing macro select a particular macro. below there is macro-in with scroll downs select open all workbooks save close and reopen the sheet containing macro.

hope this helps
regards
harsha
 
Upvote 0
Not quite. I need the code from "Sheet1" to be pasted into the code for each new sheet that is added to the workbook automatically, that way no one has to go in and make changes to the macro coding.
 
Upvote 0
Figured it out. I just wrote in code to copy the sheet, rename it, clear the contents and move it to the end.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top