Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date in Header


How can I manipulate the date in the header for a date 5 days from now
or five days from anytime a sheet is printed. (With a Macro):confused

--
PBANK
-----------------------------------------------------------------------
PBANKS's Profile: http://www.excelforum.com/member.php...fo&userid=3137
View this thread: http://www.excelforum.com/showthread.php?threadid=51576

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date in Header


=now()+5
this usually well.


--
archivesgirl
------------------------------------------------------------------------
archivesgirl's Profile: http://www.excelforum.com/member.php...o&userid=31827
View this thread: http://www.excelforum.com/showthread...hreadid=515761

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Date in Header

You'll have to use some VBA to to this.

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Me.Worksheets("Sheet1").PageSetup
.LeftHeader = Format(Date+5, "mm/dd/yyyy")
End With
End Sub

If you want to try...

rightclick on the excel icon to the left of the File|Edit|View toolbar.
Select view code and paste that subroutine into the code window.

Change the sheet name that you need (and .leftheader to what you need) and back
to excel to do File|Print preview.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

If you want to read more about these kinds of events:

Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

PBANKS wrote:

How can I manipulate the date in the header for a date 5 days from now,
or five days from anytime a sheet is printed. (With a Macro)

--
PBANKS
------------------------------------------------------------------------
PBANKS's Profile: http://www.excelforum.com/member.php...o&userid=31370
View this thread: http://www.excelforum.com/showthread...hreadid=515761


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date in Header


Thanks to both of you, I found a solution using input from each of you.


--
PBANKS
------------------------------------------------------------------------
PBANKS's Profile: http://www.excelforum.com/member.php...o&userid=31370
View this thread: http://www.excelforum.com/showthread...hreadid=515761

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Header Date TomCat Excel Discussion (Misc queries) 4 November 11th 07 10:43 AM
Date in header that is not the current date TW[_2_] Excel Discussion (Misc queries) 0 August 17th 07 02:03 AM
Date in header that is not the current date JLatham Excel Discussion (Misc queries) 0 August 17th 07 01:47 AM
Header date ronnomad Excel Discussion (Misc queries) 6 December 12th 06 04:31 PM
I want to have a header date plus one day? Jerkie Jedi Excel Discussion (Misc queries) 1 October 20th 06 03:03 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"