PDA

View Full Version : Cell Values in Header



SaraCop
03-03-2012, 10:39 AM
This bit of code displays a cell value in the header for each page

Sub UpdateHeader()
ActiveSheet.PageSetup.Leftheader = Range("A1").Value
End Sub


I would like to change it to have a different header on each page eg:
page 1 = A1
page 2 = A2
page 3 = A3 etc

Does anyone know if this is possible?

mdmackillop
03-03-2012, 10:59 AM
You could change it as you print
Sub UpdateHeader()
For i = 1 To 3
ActiveSheet.PageSetup.LeftHeader = Cells(1, i).Value
ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i
Next
End Sub