More on Save As Macro

W

wendyh

Previous assistance worked but required me to type in the VB code. Is there any way to create the macro using the recorder (not typing in code)?
I need a macro the brings up the Save As box so I can save my workbook with a different name each time I use it. I haven't found a way to stop the recorder while the Save As box is on screen.
 
H

Harald Staff

Hi

Here's a macro that includes this dialog:

Sub Test()
Dim Fname As Variant
Fname = Application.GetSaveAsFilename("", "Workbook (*.xls), *.xls")
If Fname = False Then Exit Sub
ActiveWorkbook.SaveAs CStr(Fname)
End Sub

HTH. Best wishes Harald

wendyh said:
Previous assistance worked but required me to type in the VB code. Is
there any way to create the macro using the recorder (not typing in code)?
I need a macro the brings up the Save As box so I can save my workbook
with a different name each time I use it. I haven't found a way to stop the
recorder while the Save As box is on screen.
 
G

Gord Dibben

Don't type it in. Just copy Harald's code from this post and paste it into a
module.

Gord Dibben Excel MVP
 
Top