Delete worksheets that are no longer required

TedX

Board Regular
Joined
Apr 18, 2021
Messages
122
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I'd like to create a macro, but I am not sure how to go about it. I have a workbook that I update every day which creates some new worksheets and corresponding new connections. Please see the image below. After I have taken a copy of the relevant data, I have to delete the worksheets and Connections each day manually. The worksheets always have 'Append1', whilst the other worksheets I don't need all follow the naming convention of 'Table 5' as an example. I never know how many tables there will be, each day is different, but they are all variations of the word Table a space and a number. It's the same with the connections. Can anyone create the VBA code for this macro for me please?

Image1.jpg
 
Thank you, that has cleaned up the code from 3 macros down to just one.
Im glad to help you.

Note: You should mark as an answer the post that actually answered your question. Unless your own answer is the solution.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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