I have a VBA script that copies a specified sheet to a new workbook.
The problem is I want to automatically save the new workbook with the file name "1st Order" & the cell value in B5
Here is my code:
Does anyone know how I can do that with my current code?
Thanks
The problem is I want to automatically save the new workbook with the file name "1st Order" & the cell value in B5
Here is my code:
VBA Code:
Sub SaveSplitOrder1()
Dim NewName As String
Dim nm As Name
Dim ws As Worksheet
With Application
.ScreenUpdating = False
On Error GoTo ErrCatcher
Sheets(Array("1")).Copy
On Error GoTo 0
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.Copy
Application.CutCopyMode = False
Cells(1, 1).Select
ws.Activate
Next ws
Cells(1, 1).Select
.ScreenUpdating = True
End With
Exit Sub
ErrCatcher:
MsgBox "Specified sheets do not exist within this workbook"
End Sub
Does anyone know how I can do that with my current code?
Thanks
Last edited by a moderator: