Drop down list within VBA

Yoepy

New Member
Joined
Feb 22, 2015
Messages
44
Hi all, hope someone can assist.

I have a blank template which I add to the workbook as a new event is created.

I have now noticed there are three other circumstances which require different templates. So I will have Blank1, Blank2, Blank3 and Blank4 templates.

Currently i just have a piece of code which adds the new sheet (and then does a whole lot of other stuff).

Code:
Sheets("Blank1").Copy After:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = "Sheet" & ActiveSheet.Index

How do I get a selection box to pop up when I run the "NewSheet" macro which asks "Which template do you want to add?" and then adds the appropriate blank?

Thanks in advance.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this code
Code:
Sub Macro1()


Sheets(InputBox("Enter Sheet Name:", "SHEET NAME")).Copy After:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = "Sheet" & ActiveSheet.Index
    
    End Sub
 
Upvote 0
Thanks, but I don't want to type the choice. I must be able to use a drop down or data validation list
user-offline.png
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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