The problem I was having with that is going back and forth between the parentworkbook and the newly created workbook as the calculations in the new workbook were based on pivot tables located in the parent workbook. I also felt it would be more efficient to move the sheets that needed to be moved all at once as opposed to one at a time. This is what I have so far, not quite what I wanted, but it works:
Quote:
Sub MoveSheets()
Dim ws As Worksheet, ss As Worksheet, Wb As Workbook
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Test" And ws.Name <> "PALs" And ws.Name <> "Sheet2" Then
If Wb Is Nothing Then
ws.Move
Set Wb = ActiveWorkbook
Else
ws.Move after:=ss
End If
Set ss = ActiveSheet
End If
Next ws
Application.ScreenUpdating = True
End Sub
|
This was based on code I found on OZGrid.com. If anybody knows of a more efficient way, i'd be more than inclined to listen.