Save a File with a cell value

G

Guest

I have set my Excel file to save to a aprticular location, however I want to
be able to have the filename made up from the value in a worksheet cell i.e.

Currently I have

ChDir "C:\REPORTS"
ActiveWorkbook.SaveAs Filename:="C:\REPORTS\mailinglist.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

I want where the file name is mailinglist.xsl to be populated by a value
from a cell i.e. colleges21092005.xls (cellvalue+currentdate+filetype)

Any pointers would be greatly appreciated!


Tia
 
G

Guest

Put

"C:\REPORTS\" & Range("A1").Value & Replace(Date, ".", "") & ".xls"

in place of the filename! Substitute "A1" with the cell reference you want
to get the name from!

Regards,
Stefi



„Jonathan†ezt írta:
 
B

Bob Phillips

simpler to use Format for date, no international issues then, and better to
format as yyyymmdd for sorting purposes

Format(Date, "yyyymmdd")
 
G

Guest

Yeees, I forgot that I have a specific default date format with "."s!
Stefi


„Bob Phillips†ezt írta:
 

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