A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

current date in header



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2005, 09:30 PM
RachelN
external usenet poster
 
Posts: n/a
Default current date in header

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!
  #2  
Old May 16th, 2005, 10:49 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!


  #3  
Old May 17th, 2005, 09:06 PM
RachelN
external usenet poster
 
Posts: n/a
Default

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!



  #4  
Old May 17th, 2005, 11:00 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

Make that Control PanelDate and Time, not Regional Options.


Gord

On Thu, 19 May 2005 14:59:21 -0700, Gord Dibben gorddibbATshawDOTca wrote:

You can test right now if you want to change your system date in Regional
Options.

Close Excel and change the date then open the workbook.

But.....it will work so no need to test.


Gord Dibben Excel MVP

On Tue, 17 May 2005 13:06:08 -0700, "RachelN"
wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!



  #5  
Old May 19th, 2005, 02:51 PM
RachelN
external usenet poster
 
Posts: n/a
Default

Gord,
When I opened the spreadsheet today, the date displayed is 5/17/2005. I'm
looking for some code to display the dynamic current date, so that it will
change from day to day.
Any ideas for that?
Rachel


"RachelN" wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!



  #6  
Old May 19th, 2005, 06:25 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

This line:

ActiveSheet.PageSetup.RightFooter = Date

Adjusts the rightfooter of the activesheet. (If you enabled macros.)

If you want a specific worksheet's footer to change, then you can be more
specific.

worksheets("sheet99").PageSetup.RightFooter = Date



RachelN wrote:

Gord,
When I opened the spreadsheet today, the date displayed is 5/17/2005. I'm
looking for some code to display the dynamic current date, so that it will
change from day to day.
Any ideas for that?
Rachel

"RachelN" wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!



--

Dave Peterson
  #7  
Old May 19th, 2005, 10:59 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

You can test right now if you want to change your system date in Regional
Options.

Close Excel and change the date then open the workbook.

But.....it will work so no need to test.


Gord Dibben Excel MVP

On Tue, 17 May 2005 13:06:08 -0700, "RachelN"
wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!




  #8  
Old May 24th, 2005, 06:51 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

Rachel

Did you place the code in the Thisworkbook module?

Works for me.

Test by temporarily changing your system date in Control PanelDate and Time.

Then re-open the workbook.


Gord

On Thu, 19 May 2005 12:25:29 -0500, Dave Peterson
wrote:

This line:

ActiveSheet.PageSetup.RightFooter = Date

Adjusts the rightfooter of the activesheet. (If you enabled macros.)

If you want a specific worksheet's footer to change, then you can be more
specific.

worksheets("sheet99").PageSetup.RightFooter = Date



RachelN wrote:

Gord,
When I opened the spreadsheet today, the date displayed is 5/17/2005. I'm
looking for some code to display the dynamic current date, so that it will
change from day to day.
Any ideas for that?
Rachel

"RachelN" wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the &[Date] into
a custom header so that the current date always shows up in the header when
you open a worksheet? When I use the &[Date], it places the current date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to do
this? Thanks for your help!



  #9  
Old July 1st, 2005, 07:56 PM
sharon ARdrey
external usenet poster
 
Posts: n/a
Default

=today()

"RachelN" wrote in message
...
Gord,
When I opened the spreadsheet today, the date displayed is 5/17/2005. I'm
looking for some code to display the dynamic current date, so that it will
change from day to day.
Any ideas for that?
Rachel


"RachelN" wrote:

Gord,
Thanks for the code. I had no problem inserting this into VBA code and
the
footer displayed 5/17/2005 with no problema. Now tomorrow, it should
display
5/18/2005 and then I will be a happy camper.
Rachel

"Gord Dibben" wrote:

Rachel

Several ways to do this. All involve VBA code.

Are you OK with that?

Private Sub Workbook_Open()
ActiveSheet.PageSetup.RightFooter = Date
End Sub

Alternative.........

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Date
End Sub

If you want all sheets to have the current date replace with this code.

Private Sub Workbook_Open()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = Date
Next
End Sub

To enter this code, right-click on the Excel icon left of "File" on
menu and
select "View Code". Paste one of the above in there.


Gord Dibben Excel MVP


On Mon, 16 May 2005 13:30:11 -0700, "RachelN"
wrote:

I need to insert the TODAY function or other parameter after the
&[Date] into
a custom header so that the current date always shows up in the header
when
you open a worksheet? When I use the &[Date], it places the current
date,
but when I open it up the next day, it's got the old date. I need the
current date to display each day I open the file. Anybody know how to
do
this? Thanks for your help!




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert future date based on current date plus 14 days John Bakker General Discussion 1 January 31st, 2005 09:08 PM
Date between date1 and current date Luke Running & Setting Up Queries 6 January 28th, 2005 06:26 AM
Word's current date is different from system date Wayne Thomas General Discussion 5 January 26th, 2005 10:06 PM
Run Query from date to date, Print the from date to date in the header of the report? Dustin Swartz Running & Setting Up Queries 1 January 25th, 2005 07:06 PM
Outlook 2003 BUG: Does not recognise 'Date:' header James Cocker General Discussion 2 September 5th, 2004 10:54 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.