I am trying to write code which copies the activesheet (called "Data"), opens a new workbook, pastes the data into it and closes the new sheet as "sales 2008" followed by the date. What I have at the moment is:Unfortunately it's not working. It opens a new workbook (called book1) but then tries to close my existing workbook![]()
Sub save_sheets_as_workbooks() Dim d As String Dim a As Integer Sheets("data").Select Sheets("data").copy d = ThisWorkbook.path & "\" & Workbooks("sales 2008.xls") & " " & Day(Date) & "." & Month(Date) & "." & Year(Date) & ".xls" ActiveWorkbook.SaveAs d9 ActiveWorkbook.Close ' End Sub
Bookmarks