Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone help me.
I have a an excel file with formulas saved as a template. When I open the file I need to automatically add the StartDate and StopDate to the Page Header. The End-User enters 2 dates that are saved as variables. The start date (StartDate), and the end date (StopDate). these dates are entered in the following format xx/yy/zzzz. I want to add this to the Top Right side of the Printed page. Since the dates change everytime I figured I could use the variables. However I do Not know how to accomplish this. What I want to appear on the Top Right of the page is: Traffic Data from 09/01/2003 to 09-10/2003 Any and all help will be greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Add this code to the module ThisWorkbook: Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.RightHeader = "Traffic Data from " & CStr(StartDate) & " to " & CStr(StopDate) End Sub -- JP http://www.solutionsvba.com "Ralph" wrote in message ... Can anyone help me. I have a an excel file with formulas saved as a template. When I open the file I need to automatically add the StartDate and StopDate to the Page Header. The End-User enters 2 dates that are saved as variables. The start date (StartDate), and the end date (StopDate). these dates are entered in the following format xx/yy/zzzz. I want to add this to the Top Right side of the Printed page. Since the dates change everytime I figured I could use the variables. However I do Not know how to accomplish this. What I want to appear on the Top Right of the page is: Traffic Data from 09/01/2003 to 09-10/2003 Any and all help will be greatly appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
JP,
THanks that added the Text I wanted however it over- wrote the Font command. The Font was originally set for 12 Bold, now it comes up the default 10 Regular. Any Ideas. Thanks again for your assistance. -----Original Message----- Hi, Add this code to the module ThisWorkbook: Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.RightHeader = "Traffic Data from " & CStr(StartDate) & " to " & CStr(StopDate) End Sub -- JP http://www.solutionsvba.com "Ralph" wrote in message ... Can anyone help me. I have a an excel file with formulas saved as a template. When I open the file I need to automatically add the StartDate and StopDate to the Page Header. The End-User enters 2 dates that are saved as variables. The start date (StartDate), and the end date (StopDate). these dates are entered in the following format xx/yy/zzzz. I want to add this to the Top Right side of the Printed page. Since the dates change everytime I figured I could use the variables. However I do Not know how to accomplish this. What I want to appear on the Top Right of the page is: Traffic Data from 09/01/2003 to 09-10/2003 Any and all help will be greatly appreciated. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing all Dates on Headers | Excel Worksheet Functions | |||
Changing headers without macros or VB | Excel Discussion (Misc queries) | |||
Printing Headers on only first page and Footers on only last page | Excel Discussion (Misc queries) | |||
CHANGING THE COLUMN HEADERS FROM ABC.. TO 123.. | Excel Discussion (Misc queries) | |||
Changing objects on other Worksheets with Variables | Excel Programming |