Use different cell content as headers

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
 
B

Bernard Liengme

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
 
G

Gord Dibben

Not without creating 3 print jobs.

One for each sheet to be printed.


Gord Dibben MS Excel MVP
 
I

igbert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top