Dialogue Box - how do I get and save as file name entered?

G

Guest

I save a copy of an updated excel file each day to the same directory. I
want to create a macro that prompts for the daily file name and saves it to a
predetermined file location. THanks.
 
G

Guest

Tim C said:
I save a copy of an updated excel file each day to the same directory. I
want to create a macro that prompts for the daily file name and saves it to a
predetermined file location. THanks.

Use a modified version of this (no error checking added):-

Sub SaveMe()
myFileName = InputBox("Enter filename") & ".xls"
myDir = "C:\" 'enter correct path name
ActiveWorkbook.SaveAs Filename:= _
myDir & "\" & Filename, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
end sub
 
G

Guest

Thank you!
--
Tim C


bigwheel said:
Use a modified version of this (no error checking added):-

Sub SaveMe()
myFileName = InputBox("Enter filename") & ".xls"
myDir = "C:\" 'enter correct path name
ActiveWorkbook.SaveAs Filename:= _
myDir & "\" & Filename, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top