I have a workbook with a master sheet ("Master"). If certain criteria are met, it creates sheets "1,2,and 3", but sometimes it may only create sheets "1 and 2" and so on.
My problem is that I want it to delete the existing sheets "1,2 and 3" when a button is pressed. This works fine if all three sheets have been created, but if they haven't I get an error that no sheet by that name exists.
How can I write a macro that will delete whatever sheets exist, but leave the master sheet alone?
My problem is that I want it to delete the existing sheets "1,2 and 3" when a button is pressed. This works fine if all three sheets have been created, but if they haven't I get an error that no sheet by that name exists.
How can I write a macro that will delete whatever sheets exist, but leave the master sheet alone?