Naming Excel File

K

KINGER

Does anyone know of a way where you can save an Excel file & the filename can be assigned from a cell within the worksheet
I know you can retrieve the filename into a cell, but I wish to go the other way - when we save the file it will use a filename that is in an assigned cell.
 
B

Bob Phillips

You need VBA to do it. Add this code to a macro in a general code module

Assuming the value is in cell A1 of Sheet1, you use

ActiveWorkbook.SaveAs Filename:=Worksheets("Sheet1").Range("A1") &".xls"

You could assign the macro to a toolbar button, or run it directly.
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

KINGER said:
Does anyone know of a way where you can save an Excel file & the filename
can be assigned from a cell within the worksheet?
I know you can retrieve the filename into a cell, but I wish to go the
other way - when we save the file it will use a filename that is in an
assigned cell.
 

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