Hi All, I have a script that copies each sheet in a workbook into its own workbook. I am trying to exclude sheets that contain "EEs" and can't seem to get it to recognize this. Any thoughts? Below is my current code:
Code:
Sub SplitEachWorksheetDepReport()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each ws In ThisWorkbook.Sheets
If ws.Name Like "EEs*" = False And ws.Name <> "Master" And ws.Name <> "Controls" And ws.Name <> "Check Returns" Then
ws.Copy
Application.ActiveWorkbook.SaveAs Filename:="C:\User" & "\" & ws.Name & ".xlsx"
Application.ActiveWorkbook.Close False
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "Complete"
End Sub