Using Variables in filenames

B

Blinky Bill

I want to automatically name a file created from a particular template.

I want the filename to be todays date.

i.e. I open timesheet.xlt and the file is created as
My Documents\Timesheets\ddmmyyyy.XLS

This template will be distributed to several users.

I am using Excel 2002 SP3
 
B

Bob Phillips

ActiveWorkbook.SaveAs Filename:= "C:\MyDocuments\Timesheets\" &
Format(Date,"ddmmyyyy") & ".xls"

although I would suggest you use a format of yyyymmdd, so that it is
ordered.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Blinky Bill

Thankyou for your help

Bob Phillips said:
ActiveWorkbook.SaveAs Filename:= "C:\MyDocuments\Timesheets\" &
Format(Date,"ddmmyyyy") & ".xls"

although I would suggest you use a format of yyyymmdd, so that it is
ordered.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top