Use different cell content as headers

  • Thread starter Thread starter igbert
  • Start date Start date
I

igbert

Would anyone knows how a marco to insert different cell content as header
onto different worksheets within a workbook?


For Example

Sheet 1 : use Cell A1 as header
Sheet 2 : usse Cell F2 as header
Sheet 3 : use Cell M5 as header

Igbert
 
Try this
Sub Macro1()
With ActiveSheet.PageSetup
.LeftHeader = Range("A1").Value
.CenterHeader = Range("F2").Value
.RightHeader = Range("M5").Value
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
End With
End Sub

If you wish to learn the some basic (forgive the pun) VBA, try using Tools |
Macros | Record Macro
best wishes
 
Not without creating 3 print jobs.

One for each sheet to be printed.


Gord Dibben MS Excel MVP
 
Hi Bernard,

Is there a way to autorun this macro. Also, is it possible to use two cells
content as header? i.e. A1 and A2 for Sheet 1, B3 and B4 for Sheet 2

Thanks

Igbert
 
Back
Top