ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Add date to all new files (https://www.excelbanter.com/excel-discussion-misc-queries/56839-add-date-all-new-files.html)

Kristin Broggi

Add date to all new files
 
I am working with Excel XP and I am looking for a way to have the current
date (static) display in the footer of all new files I create. I can create a
macro to insert the footer in the date but I cannot figure out how to get it
to run every time I create a new file. In Word, I can name the macro autonew
and I am all set. Any suggestions for Excel?
Thanks
Kristin

Gord Dibben

Add date to all new files
 
Kristin

Open a new workbook. Customize as you wish. FileSave As Type: scroll down
to Excel Template(*.XLT) and select. Name your workbook "BOOK"(no quotes).
Excel will add the .XLT to save as BOOK.XLT.

Store this workbook in the XLSTART folder usually located at........

C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART

This will be the default workbook for FileNew

Existing workbooks are not affected by these settings.

You can also open a new workbook and delete all but one sheet. Customize as
you wish then save this as SHEET.XLT in XLSTART folder also. It now becomes
the default InsertSheet.

More can be found on this in Help under "templates"(no quotes).


Gord Dibben Excel MVP

On Tue, 22 Nov 2005 14:17:05 -0800, "Kristin Broggi"
wrote:

I am working with Excel XP and I am looking for a way to have the current
date (static) display in the footer of all new files I create. I can create a
macro to insert the footer in the date but I cannot figure out how to get it
to run every time I create a new file. In Word, I can name the macro autonew
and I am all set. Any suggestions for Excel?
Thanks
Kristin



Kristin Broggi

Add date to all new files
 
Thank you. I have been able to do this but....
I want the XL file "date stamped" If I create it on 11/29/05, I want the
footer to always read 11/29/05. I can't figure out how to do this.
Any other suggestions.
Kristin

"Gord Dibben" wrote:

Kristin

Open a new workbook. Customize as you wish. FileSave As Type: scroll down
to Excel Template(*.XLT) and select. Name your workbook "BOOK"(no quotes).
Excel will add the .XLT to save as BOOK.XLT.

Store this workbook in the XLSTART folder usually located at........

C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART

This will be the default workbook for FileNew

Existing workbooks are not affected by these settings.

You can also open a new workbook and delete all but one sheet. Customize as
you wish then save this as SHEET.XLT in XLSTART folder also. It now becomes
the default InsertSheet.

More can be found on this in Help under "templates"(no quotes).


Gord Dibben Excel MVP

On Tue, 22 Nov 2005 14:17:05 -0800, "Kristin Broggi"
wrote:

I am working with Excel XP and I am looking for a way to have the current
date (static) display in the footer of all new files I create. I can create a
macro to insert the footer in the date but I cannot figure out how to get it
to run every time I create a new file. In Word, I can name the macro autonew
and I am all set. Any suggestions for Excel?
Thanks
Kristin




Gord Dibben

Add date to all new files
 
Kristin

Place this UDF in a General Module of your BOOK.XLT

Function DocProps(prop As String)
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

Place this code in your BOOK.XLT Thisworkbook Module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.RightFooter = DocProps("creation date")
End With
Next ws
End Sub

Store BOOK.XLT in your XLSTART folder.

All FileNew workbooks will be based upon BOOK.XLT


Gord


On Tue, 29 Nov 2005 07:36:15 -0800, "Kristin Broggi"
wrote:

Thank you. I have been able to do this but....
I want the XL file "date stamped" If I create it on 11/29/05, I want the
footer to always read 11/29/05. I can't figure out how to do this.
Any other suggestions.
Kristin

"Gord Dibben" wrote:

Kristin

Open a new workbook. Customize as you wish. FileSave As Type: scroll down
to Excel Template(*.XLT) and select. Name your workbook "BOOK"(no quotes).
Excel will add the .XLT to save as BOOK.XLT.

Store this workbook in the XLSTART folder usually located at........

C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART

This will be the default workbook for FileNew

Existing workbooks are not affected by these settings.

You can also open a new workbook and delete all but one sheet. Customize as
you wish then save this as SHEET.XLT in XLSTART folder also. It now becomes
the default InsertSheet.

More can be found on this in Help under "templates"(no quotes).


Gord Dibben Excel MVP

On Tue, 22 Nov 2005 14:17:05 -0800, "Kristin Broggi"
wrote:

I am working with Excel XP and I am looking for a way to have the current
date (static) display in the footer of all new files I create. I can create a
macro to insert the footer in the date but I cannot figure out how to get it
to run every time I create a new file. In Word, I can name the macro autonew
and I am all set. Any suggestions for Excel?
Thanks
Kristin






All times are GMT +1. The time now is 07:02 AM.

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