Save a new file with the name that is in cell "C7"

  • Thread starter Thread starter lunker55
  • Start date Start date
L

lunker55

Here is what I want to do:
Open up a template. Enter information. Click on save, and when the window
shows up asking me to name the file, I want it to automatically use a file
name with the value in cell C7.

As an example, if cell C7 has "Milton 287-12", I want to automatically name
the file"Milton 287-12" when I save for the first time.
Is this possible?
Thanks,
Joe
 
Hi, Lunker,

Try pasting the following code into a macro sheet and running it with Alt-F8
Change the path to whatever you require between the quote in line 3 and "A1"
to whatever cell you want to use to contain the filename.

Have a good weekend

Pete

Sub SaveAsCellString()
ActiveWorkbook.SaveAs Filename:= _
"D:\" & Range("A1").Formula, FileFormat:=xlExcel9795, _
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

Back
Top