View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Printing to header/footer programatically

You can use VBA to set the BeforePrint to print the same footer


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
If .Range("A1") = "my value" Then
.PageSetup.LeftFooter = "Some text"
End If
End With
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dean" wrote in message
...
I would like to be able to set a message to print in the footer/header of

a
printed page depending on certain criteria in the spreadsheet.

Can someone suggest/advise how I could go about this.

Thanks in advance
Dean