File SAVE AS ... use cell value as pasrt of name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It is possible to setup a macro to automatically save (SAVE AS) a workbook and use the value in a specific cell as part of the new file name.
 
You could record a macro when you do a file|saveas and modify it slightly.

I got this when I recorded one:

ActiveWorkbook.SaveAs Filename:="C:\My Documents\excel\book2.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

If I wanted to use Sheet1, A1 as the holder for the value:

ActiveWorkbook.SaveAs _
Filename:="C:\My Documents\excel\" _
& worksheets("sheet1").range("a1").value & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

I specified my folder and added ".xls" as the extension.

I'm not sure what automatic means.
 

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