Greetings all,
Have an issue where I need to set up sheet as a "template" then have a button on that sheet which will copy the contents of the template to a new tab.
The button should only be available on the Template sheet.
Any ideas?
Thanks,
Brad
Setup Tab as Template and copy as needed
-
- 4StarLounger
- Posts: 545
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 78629
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Setup Tab as Template and copy as needed
Use a command button from the Forms toolbar, so that you can assign a macro in a standard toolbar to it.
Here is the macro:
This assumes that the command button will be the first (or only) one on the sheet.
Here is the macro:
Code: Select all
Sub CopySheet()
Dim wshOld As Worksheet
Dim wshNew As Worksheet
Set wshOld = ActiveSheet
wshOld.Copy After:=Worksheets(Worksheets.Count)
Set wshNew = Worksheets(Worksheets.Count)
wshNew.Buttons(1).Delete
End Sub
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 545
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Setup Tab as Template and copy as needed
Thanks Hans.
One question, I do not seem to ba able to locate the forms toolbar. I am in Excel 2007.
Thanks,
Brad
One question, I do not seem to ba able to locate the forms toolbar. I am in Excel 2007.
Thanks,
Brad
-
- Administrator
- Posts: 78629
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Setup Tab as Template and copy as needed
Activate the Developer tab of the ribbon.
(If you do not see it, click the Office button, then Word Options. If necessary, click Popular. Tick the check box "Show Developer tab in the Ribbon". Click OK.)
Click the Insert button in the Controls group of the ribbon.
The top half of the palette that drops down contains the controls from the Forms toolbar.
(If you do not see it, click the Office button, then Word Options. If necessary, click Popular. Tick the check box "Show Developer tab in the Ribbon". Click OK.)
Click the Insert button in the Controls group of the ribbon.
The top half of the palette that drops down contains the controls from the Forms toolbar.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 545
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Setup Tab as Template and copy as needed
Wow, I got side tracked. Thanks for the detail!
Brad
Brad