So I have one workbook with about 50 worksheets (tabs). Is there a way to split each tab and save as their own workbook? Here's the quirk, the master workbook has one (lookup table) sheet that has to be copied with each of those other sheets.
Master Workbook (1 lookup tab + 49 tabs)
[lookup tab] [tab a] [tab b] [tab c] [tab d]....
So basically the [lookup tab] has to be copied with each of the rest of the tabs so I can save as a new workbook containing two tabs.
- new workbook 1 would contain [lookup tab] [tab a]
- new workbook 2 would contain [lookup tab] [tab b]
and so on...
I found the below VBA code in a search but I believe it's for single sheets only. Can anybody help?? I'd be very grateful as it would save me quite a bit of time.
Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String
Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
wbNew.SaveAs strFilename
wbNew.Close
Next ws
End Sub
Master Workbook (1 lookup tab + 49 tabs)
[lookup tab] [tab a] [tab b] [tab c] [tab d]....
So basically the [lookup tab] has to be copied with each of the rest of the tabs so I can save as a new workbook containing two tabs.
- new workbook 1 would contain [lookup tab] [tab a]
- new workbook 2 would contain [lookup tab] [tab b]
and so on...
I found the below VBA code in a search but I believe it's for single sheets only. Can anybody help?? I'd be very grateful as it would save me quite a bit of time.
Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String
Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
wbNew.SaveAs strFilename
wbNew.Close
Next ws
End Sub