M
Mike
I used the following code to delete all the sheets except Sheets("Dummy").
It does this successfully for about 10 of the sheets, but there are 5 other
sheets whose actual WorkSheets ARE deleted but their CODE sheets remain.
What I see in the VBAProject window BEFORE deletion is "Sheet1( sheetxyz)"
and then AFTER the deletion I see "Sheet1". Only one of the code sheets
actually contained code.
Any ideas??
Dim wb As Workbook
Dim oSheet As Object
Set wb = ActiveWorkbook
For Each oSheet In wb.Sheets
If oSheet.Name <> "Dummy" Then
Sheets(oSheet.Name).Select
ActiveWindow.SelectedSheets.Delete
End If
Next
It does this successfully for about 10 of the sheets, but there are 5 other
sheets whose actual WorkSheets ARE deleted but their CODE sheets remain.
What I see in the VBAProject window BEFORE deletion is "Sheet1( sheetxyz)"
and then AFTER the deletion I see "Sheet1". Only one of the code sheets
actually contained code.
Any ideas??
Dim wb As Workbook
Dim oSheet As Object
Set wb = ActiveWorkbook
For Each oSheet In wb.Sheets
If oSheet.Name <> "Dummy" Then
Sheets(oSheet.Name).Select
ActiveWindow.SelectedSheets.Delete
End If
Next