'Save As' macro

W

wendyh

I need to record a macro that allows me to save the workbook with another file name. I cannot stop the recorder with the 'Save As' window active. My workbook needs to be saved with a different fiename each time I use it for customer details.
 
B

Bernie Deitrick

Wendy,

If you want to navigate to your folder and manually enter your filename:

Sub WendySaver()
ActiveWorkbook.SaveAs Application.GetSaveAsFilename
End Sub

Otherwise, you could automatically create a file name (such as from the
value of a certain cell with a date appended), but you would need to post
your requirements first to make that a worthwhile exercise.

HTH,
Bernie
MS Excel MVP

wendyh said:
I need to record a macro that allows me to save the workbook with another
file name. I cannot stop the recorder with the 'Save As' window active. My
workbook needs to be saved with a different fiename each time I use it for
customer details.
 
B

Bob Phillips

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wendyh said:
I need to record a macro that allows me to save the workbook with another
file name. I cannot stop the recorder with the 'Save As' window active. My
workbook needs to be saved with a different fiename each time I use it for
customer details.
 
B

Bob Phillips

Add an input box, something like

Sub Macro1
Dim sFile

sFile = InputBox("Supply file name")
If sFile <> "" Tyhen
Activeworkbook.SaveAs Filename:=sFile
End If

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wendyh said:
I need to record a macro that allows me to save the workbook with another
file name. I cannot stop the recorder with the 'Save As' window active. My
workbook needs to be saved with a different fiename each time I use it for
customer details.
 
Top