-
Delete Selected Sheet
Hi Experts,
Thank you for all your help. I just want to ask if Excel has a functionality selecting what sheets to be deleted. I have a workbook that has 50++ sheets. I would like to create a function (probably a customized "Remove Sheet" button). Whenever this function is called. It will popup list of all the sheets which you can select individually (probably by ticking a checkbox) and then a delete confirmation button.
You guys have been very helpful. Thank you in advance.
Regards,
Tony
-
I put together a simple demo of how to do this (see attached). Basically you just create a user form with a listbox (with multi select enabled). When the form loads you add every worksheet name to the listbox. Then you select all the sheets you want to delete, and hit a button that runs through your listbox's items and sees which are selected, deleting each.
-
Hi jfournier,
Thank you very much. I was able to work on the user form and I was able to generate the list when I ran the codes. However, I would like to run it from a command button (ex: Remove Sheet). Once I clicked on this button, the user form will popup giving me an option to delete. How can I work around this.
As I see from your attachment that I need to go to Visual Basic and run the scripts from there, then the user form will popup. How can I link the script from a command button ("Remove Sheet")
Regards,
Tony
-
your script just needs to say "frmDeleteSheets.Show 0"
replace frmDeleteSheets with whatever I named the form. I don't remember at the moment.
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules