Hi guys,
I'm trying to copy 3 sheets at a time to a new workbook which repeats multiple times ie 9 sheets going to 3 workbooks. What I've got below copies every sheet to new individual workbooks (one sheet per book) which is a good start, just need to adapt it to specify which 3 sheets to copy. Any ideas?
Thanks!
I'm trying to copy 3 sheets at a time to a new workbook which repeats multiple times ie 9 sheets going to 3 workbooks. What I've got below copies every sheet to new individual workbooks (one sheet per book) which is a good start, just need to adapt it to specify which 3 sheets to copy. Any ideas?
Thanks!
VBA Code:
Sub ExportToWorkbooks()
Dim NewBook As Workbook, OldBook As Workbook, sh As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set OldBook = ThisWorkbook
For Each sh In OldBook.Worksheets
If sh.Visible = True Then
sh.Copy
ActiveWorkbook.SaveAs Filename:=OldBook.Path & "\" & sh.Name & "VALUES", FileFormat:=xlWorkbookNormal
ActiveWorkbook.Close
End If
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub