ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using Variables in filenames (https://www.excelbanter.com/excel-discussion-misc-queries/16754-using-variables-filenames.html)

Blinky Bill

Using Variables in filenames
 
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

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)


"Blinky Bill" <Blinky wrote in message
...
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




Blinky Bill

Thankyou for your help

"Bob Phillips" wrote:

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)


"Blinky Bill" <Blinky wrote in message
...
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






All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com