Hi - I'm trying to figure out how to delete extraneous sheets in a workbook using VBA. The following code works, but only for keeping the one sheet titled "New Month" obviously. There are two other sheets I need to keep, "Column Guide" and "Data Validation". I tried to use this: If ws.Name <> "New Month" OR "Data Validation" OR "Column Guide" Then ws.delete, but it did not work
For Each ws in Sheets
Application.DisplayAlerts=False
If ws.Name <> "New Month" Then ws.delete
Next
Application.DisplayAlerts=True
Thanks!
For Each ws in Sheets
Application.DisplayAlerts=False
If ws.Name <> "New Month" Then ws.delete
Next
Application.DisplayAlerts=True
Thanks!