I am trying to simply make a copy of an entire workbook for audit purposes. The name that will be created for the workbook is based on 2 cells on the "Main" sheet. I am not sure why this is happening as I am certain this is a simple macro. In addition I would like BOTH the Template (current workbook) and the NEW workbook to save and close, without asking for any prompts. Thanks so very much!!!!
D1 - The Name of the new Workbook
B14 - Today's date
Sub SaveAudit()
' Save file as multiple cell references
Dim FName As String
Dim FPath As String
' New file name WITHOUT extension
FName = Range("$D$1").Value & Format(Range("$B$14").Value, "mm-dd-yyyy") & ".xlsb"
FPath = ThisWorkbook.Path & "" & FName
ThisWorkbook.SaveCopyAs Filename:=FPath & "" & FName
End Sub
Hi Sherry,
I am not sure why this is happening as I am certain this is a simple macro.
What is happening?
After SaveCopyAs just use:
ThisWorkbook.Close True
The copy is closed already, SaveCopyAs should create a copy without opening the newly created file.
@Catalin Bombea
Perfect! I feel so silly, as this answer IS simple just as I had thought! Thanks so very much!!!!