Home

Creation and deletion of worksheets

JStirfry
New Contributor
Can someone please help me with code for the following scenario?

A worksheet labeled "Master" contains data. A template worksheet has the name "Template". Each cell containing data in the "Master" sheet will have it's own worksheet named after the cell contents, with the worksheet in the format of the "Template" worksheet.

I need a macro that will prompt me to select a dynamic range of cells in the "Master" worksheet that will automatically create new worksheets, copied from the "Template" worksheet, for each cell selected in the range in column A. Each new worksheet should be named after the contents of each of the cells in the dynamic range selected.

Alternatively, I'd also like to have a macro to essentially do the reverse. I need it to prompt the user to the select a range and then delete worksheets that exist and do not match any of the names in the cells of the dynamic range selected. The "Master" and "Template" worksheets should be ignored so they are not deleted during this macro run.

Thanks in advance!

Justin
1 Reply

I've got something started, but can't get the code to progress past the message "The range selected must be on the Master sheet.".

Here's a link to a sample file:

Related Conversations
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
2 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
202 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies