I have something similar that you can modify:
Sub copy_QC_file()
ActiveWorkbook.Save
'
'is macro file ..
workbook1 = ActiveWorkbook.Name
'set folder for copy
copy_dir$ = Worksheets("Data").Cells(1, 22)
'set name for copy file
rl$ = Worksheets("Data").Cells(6, 1)
name3$ = "RL " & rl$ & "Output"
'select worksheets to copy to new file
Sheets(Array("Data", "Graphs")).Select
Sheets(Array("Data", "Graphs")).Copy
ChDir copy_dir$
Worksheets("Data").Cells(1, 22) = ""
Worksheets("Data").Cells(6, 1) = ""
ActiveWorkbook.SaveAs Filename:= _
name3$ & ".xlsx", _
FileFormat:=xlOpenXMLWorkbook, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Workbooks(workbook1).Worksheets("Data").Select
Range("A1").Select
End Sub
Basically, mine copies the sheets named 'Data & Graphs' to a new sheet based on the file name contained in cell 6,1 with a prefix of 'RL' and suffix of 'output'. It also clears these values output, but the bare bones is there. The directory to save is stored in cell 1,22 on the main sheet.
Bookmarks