Hello,
I have the following VBA code that will save each tab as its own file:
Currently, it will save the tab as "ABC_GL" followed by the name of the sheet. I am trying to do two things:
1) After "ABC_GL" i would want the file name to include whatever is in cell A1
2) Close the newly saved workbook that was created
Thank you for the help!
I have the following VBA code that will save each tab as its own file:
Rich (BB code):
Sub Splitbook2()
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = FalseApplication.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\"& "ABC_GL" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Currently, it will save the tab as "ABC_GL" followed by the name of the sheet. I am trying to do two things:
1) After "ABC_GL" i would want the file name to include whatever is in cell A1
2) Close the newly saved workbook that was created
Thank you for the help!