Doflamingo
Board Regular
- Joined
- Apr 16, 2019
- Messages
- 238
Hi all,
Below is the code to create a new workbook with the active worksheet of an open workbook
1, How to rename the workbook with the name of the active sheet ?
2, How to put the newly created workbook having the name of the active worksheet in a new folder created by VBA having the same name than the workbook ?
Any idea ?
Below is the code to create a new workbook with the active worksheet of an open workbook
Code:
Sub sb_Copy_Save_ActiveSheet_As_Workbook()
Set wb = Workbooks.Add
ThisWorkbook.Activate
ActiveSheet.Copy Before:=wb.Sheets(1)
wb.Activate
wb.SaveAs "C:\Users\AtivBook9\Downloads\Reims\test3.xlsx"
End Sub
1, How to rename the workbook with the name of the active sheet ?
2, How to put the newly created workbook having the name of the active worksheet in a new folder created by VBA having the same name than the workbook ?
Any idea ?