Hi all,
What I really wanted to do is when SAVE is clicked, save to a new file with file name derived from cell A1 (not to the current workbook, which is my template). I have come up with the code below. But, once SAVE is clicked, it would save to the current workbook (not good), generate a new file with file name derived from cell A1 (Good), and also generate another file Book1 (not good). Please help.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim FName As String
Dim FPath As String
FPath = "C:\Documents and Settings\Test Folder"
FName = Sheets("Sheet1").Range("A1").Text
ThisWorkbook.SaveAs Filename:=FPath & "\" & FName
End Sub
Bookmarks