P
puiuluipui
Hi, i need a macro to delete all sheets except 4 or 5 sheets.
Can this be done?
Thanks!
Can this be done?
Thanks!
Luke M said:Modifying Don's coding...
Sub Macro()
Dim strSheet As String
x = MsgBox("Did you save previous month?", vbOKCancel)
If x = vbCancel Then Exit Sub
strSheet = "Sheet1,Sheet2"
application.displayalerts=false
For Each sh In Worksheets
If InStr(1, "," & strSheet & ",", "," & sh.Name & ",", _
vbTextCompare) = 0 Then sh.Delete
Next
application.displayalerts=true
end if
End Sub
--
Best Regards,
Luke M
*Remember to click "yes" if this post helped you!*