View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Custom Headers and Footers

First put the desired formulas into cells, say A1, A2, A3. Then put the
following macro in the workbook code area:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftHeader = Range("A1").Value
.CenterHeader = Range("A2").Value
.RightHeader = Range("A3").Value
End With
Application.ScreenUpdating = True
End If
End Sub

Whenever the sheet is printed, the values of cells A1, A2, and A3 will
appear ing the header.
--
Gary''s Student - gsnu2007g


"John" wrote:

Hi,
Is it possible to use a formula into headers and footers?


Regards

John