ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Save a new file with the name that is in cell "C7" (https://www.excelbanter.com/excel-discussion-misc-queries/26049-save-new-file-name-cell-%22c7%22.html)

lunker55

Save a new file with the name that is in cell "C7"
 
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



Peter Rooney

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


"lunker55" wrote:

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




lunker55

Works perfectly!!
Thank you very much Peter.

Joe

"lunker55" wrote in message
.. .
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






All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com