Hello,
The I'm using the below macro (EX 2.) and it works perfect, but I now want to exclude the sheets named below in (Ex.1)
How can I merge this exclusion into the macro in EX 2.?
I want to split every worksheet but these three listed below.
Thanks in advance,
Gary
EX 1.
If WS.Name <> "Customized" And WS.Name <> "Create Sheets" And WS.Name <> "GF ACCTS with master and test" Then
EX 2.
Sub SplitbookTXT()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".txt", FileFormat:=xlText
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
The I'm using the below macro (EX 2.) and it works perfect, but I now want to exclude the sheets named below in (Ex.1)
How can I merge this exclusion into the macro in EX 2.?
I want to split every worksheet but these three listed below.
Thanks in advance,
Gary
EX 1.
If WS.Name <> "Customized" And WS.Name <> "Create Sheets" And WS.Name <> "GF ACCTS with master and test" Then
EX 2.
Sub SplitbookTXT()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".txt", FileFormat:=xlText
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub