Excel saving file query.

  • Thread starter Thread starter Kobus
  • Start date Start date
K

Kobus

I would like to write a macro that will, when activated,
save the current Excel file using a specific cell value
as the file name. How would one do that?

Thanks
 
Hi Kobus!

Try:
Sub SaveSpecial()
ActiveWorkbook.SaveAs (Range("FileNameCell"))
End Sub

In the workbook the cell with the File Name I want has been named
FileNameCell

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Hi
just saw a similar question at Excel.misc. Try

sub save_with_cell()
Dim fname
fname = worksheets("sheet1").range("A1").value
fname = fname & ".xls"
ActiveWorkbook.SaveAs Filename:=fname
end sub

You should add some error checking to this (does the files exist, etc.)
 
Back
Top