Delete sheets with sheets name same as a list

Rondy013

New Member
Joined
Apr 8, 2013
Messages
6
Hi, I'm trying to delete multiple sheets that is named using values in a list at first sheet.
Below are the background and procedures to be:

There is a list located at fixed range of cells, say from A1 to A28 of 1st sheet.
The content of list varied each times, say first time maybe list of: 1, 2, 3J, 3V and next maybe: 1, 1P, 2, 2J, 3V, 3X, 3Y
The next sheets are name with these contents, say 1, 2, 3J, 3V respectively for this time.
Then, how to make the macro to select and delete the sheets by itself with referring to the list?

Advance thanks....
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You could create an array as a string, pass the values into the array, select the worksheets with that variable and then delete them.
 
Upvote 0
Hi

Make an arry containing the names of the sheets you want to remove.


Code:
For i = 1 To NumRem      ' NumRem = Number of sheets to be removed
   SheetName = TobeRem(i)         ' TobeRem = Array containing the names of the sheets to be removed
   Application.Worksheets(SheetName).Delete
   Next i
 
Last edited:
Upvote 0

Forum statistics

Threads
1,203,530
Messages
6,055,935
Members
444,837
Latest member
TheBams

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