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.
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