Hello All,
I am using Excel 2010 and I have a workbook with lots of sheet for respective managers
There is one sheet name "Master' in the workbook followed by each manager sheet
I found this code on the internet which export ALL sheet as separate workbook
Sub Splitbook()
'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 & ".xls"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
My requirement is to export each sheet AFTER Master sheet together with Master sheet in each newly exported workbook
eg: if the name of the sheet is John then a new workbook would be created as John.xlsx which will have the two Sheets John and Master similar for all other sheets till the end
The VBA code should look for the sheet name Master and export the Master and all the sheets followed by Master as separate workbook in the current Path
Hope this is clear
Thanks for any help
Rashid Khan
Bookmarks