-
Cell Values in Header
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?
-
You could change it as you print
[VBA]Sub UpdateHeader()
For i = 1 To 3
ActiveSheet.PageSetup.LeftHeader = Cells(1, i).Value
ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i
Next
End Sub[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules