Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert/center multiple page header in a spreadsheet using vb6.

Status
Not open for further replies.

cassidybklyn

Programmer
Apr 23, 2007
82
US
How everyone,
how can I insert and center multiple page header in excel spreadsheet.

I intend to use:

With Activesheet.PageSetup
.CenterHeader = "&""Arial,Bold"" NEW YORK CITY TRANSIT AUTHORITY "
Telecommunication and Information Services Division
Project Tracking System
Updated For Period Ending 05/31/2007
End With

Note: the hard coded date "5/31/2007" should be a system date and I need the above headings centered.
Thanks.
Cassidy.
 
What about this ?
.CenterHeader = "&""Arial,Bold"" NEW YORK CITY TRANSIT AUTHORITY" _
& Chr(10) & "Telecommunication and Information Services Division" _
& Chr(10) & "Project Tracking System" _
& Chr(10) & "Updated For Period Ending &D"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 




If it happens that you are not going to actuappy PRINT the report for the Month ending date, for instance, if you printed MAY's report, TOMORROW, which is June 1, then you might want something like this...
Code:
.CenterHeader = "&""Arial,Bold"" NEW YORK CITY TRANSIT AUTHORITY" _
 & Chr(10) & "Telecommunication and Information Services Division" _
 & Chr(10) & "Project Tracking System" _
 & Chr(10) & "Updated For Period Ending "  & Format(DateSerial(Year(Date),Month(Date),0),"mm/dd/yy")
If you ran it TODAY, it would reflect APRIL's data; Tomorrow, MAY's

Short of that, maybe you need to reference a SPECIFIC date rather than Today's date.

Skip,

[glasses] [red][/red]
[tongue]
 
Thanks a million guys. I got it. I did the trick you taught me earlier by recording a Macro and tweaking it.
Cassidy.
 



"I did the trick you taught me earlier by recording a Macro and tweaking it."

Warms my heart, Cassidy! ;-)


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top