Populate New Sheet From Drop-down Menu Of Template Sheets

SavantE

New Member
Joined
Aug 4, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello all!

I am hoping for a solution to this seemingly simple dilemma.

I have a workbook with 8 differently named sheets that all act as templates for different project types.

I am hoping to enable a macro/vba so that any new sheet created is blank with a drop-down list that has all 8 template sheets names in it. Upon selecting one, I am hoping that the sheet will clear and populate as a copy of the template sheet.

Example. There is a template sheet for "Budget Analysis". I hit the + button to create a new sheet. The sheet has a drop-down list. I select "Budget Analysis" from the list. The drop-down list disappears and the sheet copies completely the template sheet for "Budget Analysis". Then I am free to fill it out.

Is this possible/simple?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I would recommend creating the form templates and having a "generator" worksheet. on the sheet, have a command button that pops up a combo box selector. Upon selecting a template, it gets copied. Otherwise, you're looking at a bunch of INDIRECT formulas.

Here's the Code

VBA Code:
Private Sub ToggleButton1_Click()
    If Me.ComboBox1.Value = "" Then Exit Sub
    Sheets(Me.ComboBox1.Value).Copy After:=Sheets(1)
End Sub

DuplicateSheet.gif
 
Upvote 0
I'm trying to make this work as the concept seems perfectly reasonable. Do you have a full VBA write-up to get the button to pop up the combo box? Sorry if that seems like a stupid question.

Having trouble getting this to work. And is it a toggle button or command button?
 
Upvote 0
Command button I think got renamed to Toggle Button in 365; not sure though. You can find it on the Developer Ribbon.

The other bit of code is rather small. First, create the button on the generator sheet. Assign it a new macro. The macro contains a single line - UserForm1.Show

The ComboBox on the form references a named range. I just put all the sheet names in a list and named it something like "pageNames". In the ComboBox's properties, the RowSource value is that named range.
 
Upvote 0

Forum statistics

Threads
1,215,777
Messages
6,126,835
Members
449,343
Latest member
DEWS2031

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