Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Printing / June 2004

Tip: Looking for answers? Try searching our database.

Header/Footer question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stuart - 11 Jun 2004 18:17 GMT
I have a multi-use print routine called via an addin's menu item.
The routine can identify which of three types of workbook it
is dealing with, and then process the print 'pages' accordingly.

What I would like to know is this:

assuming I can get the values via variables, where necessary,
can I print in the header/footer:
   project name  (workbook name)
   worksheetname
   print date (ie current data)
   or other things via variables

Am I right to believe leftfooter/right footer is possible?

Regards.
Rob Bovey - 11 Jun 2004 18:39 GMT
Hi Stuart,

   Yes, it's very easy to do all of this. I've posted some demo code below
to give you an idea of how it's done.

Sub HeaderFooterDemo()

   Dim szProject As String
   Dim szSheetName As String
   Dim szPrintDate As String
   Dim szOtherThings As String

   szProject = "My Project"
   szSheetName = "My Sheet"
   szPrintDate = Format(Now(), "MM/dd/yyyy")
   szOtherThings = "Other things"

   With ActiveSheet.PageSetup
       .LeftHeader = szProject
       .CenterHeader = szSheetName
       .RightHeader = szPrintDate
       .LeftFooter = szOtherThings
       .CenterFooter = szOtherThings
       .RightFooter = szOtherThings
   End With

End Sub

Signature

Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *

> I have a multi-use print routine called via an addin's menu item.
> The routine can identify which of three types of workbook it
[quoted text clipped - 17 lines]
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.703 / Virus Database: 459 - Release Date: 10/06/2004
Stuart - 11 Jun 2004 18:48 GMT
Many thanks indeed.

Regards.

> Hi Stuart,
>
[quoted text clipped - 45 lines]
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.703 / Virus Database: 459 - Release Date: 10/06/2004
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.