bloodmilksky
10-20-2016, 03:04 AM
Hi Guys,
I have found the below code to save sheet as new workbook but what I wanted to know if it is possible to change the save name
each time the macro is run to the values on sheet 1 in cells B2 & B3
Sub sb_Copy_Save_Worksheet_As_Workbook()
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Sheets("Sheet2").Copy Before:=wb.Sheets(1)
wb.SaveAs "C:\temp\test1.xlsx"
End Sub
I have found the below code to save sheet as new workbook but what I wanted to know if it is possible to change the save name
each time the macro is run to the values on sheet 1 in cells B2 & B3
Sub sb_Copy_Save_Worksheet_As_Workbook()
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Sheets("Sheet2").Copy Before:=wb.Sheets(1)
wb.SaveAs "C:\temp\test1.xlsx"
End Sub