I have the following macro which works perfectly (all credit to this site )
Dim NewName As String
Set Shts = ActiveWorkbook.Worksheets(Array("Delivery schedule Stoke", "Delivery schedule Meridian", "Salvage", "Suppliers"))
Shts.Copy
NewName = InputBox("Please Enter the name for the new workbook", "New Workbook Name")
With ActiveWorkbook
Sheets(Array("Suppliers", "SALVAGE")).Select
Sheets("Suppliers").Activate
ActiveWindow.SelectedSheets.Visible = False
.SaveAs (NewName & ".xls")
.Close savechanges:=True
End With
ThisWorkbook.Close savechanges:=False
End Sub
The only problem I have is it saves the new workbook in random places - can I change this to make it save in a particular folder.
I know I need to add the path to the code, but my attempt of:
Path = file:///\\prg-dc.dhl.com\uk\DSC\Sites\Dunelm\TRANSPORT-DRIVE-DO-NOT-MOVE\DHLMER-PLANNING\Richard\NEW%20%20Paragon%20Reporting\
Does not work!
Also with my current version of the macro (which seems to now save sheets in documents) I get an error message when opening the file:
Dim NewName As String
Set Shts = ActiveWorkbook.Worksheets(Array("Delivery schedule Stoke", "Delivery schedule Meridian", "Salvage", "Suppliers"))
Shts.Copy
NewName = InputBox("Please Enter the name for the new workbook", "New Workbook Name")
With ActiveWorkbook
Sheets(Array("Suppliers", "SALVAGE")).Select
Sheets("Suppliers").Activate
ActiveWindow.SelectedSheets.Visible = False
.SaveAs (NewName & ".xls")
.Close savechanges:=True
End With
ThisWorkbook.Close savechanges:=False
End Sub
The only problem I have is it saves the new workbook in random places - can I change this to make it save in a particular folder.
I know I need to add the path to the code, but my attempt of:
Path = file:///\\prg-dc.dhl.com\uk\DSC\Sites\Dunelm\TRANSPORT-DRIVE-DO-NOT-MOVE\DHLMER-PLANNING\Richard\NEW%20%20Paragon%20Reporting\
Does not work!
Also with my current version of the macro (which seems to now save sheets in documents) I get an error message when opening the file: