Help with header

bkunkel

New Member
Joined
Dec 19, 2018
Messages
1
I have a spreadsheet that I have inserted page breaks and I have headers and footers, can I have each header on each page be different? as is from a certain cell on each page? the issue I am having is I added a macro but and I want the cell the top left cell from each page to go into the header but it puts the number from the 1st page in all of the pages because the page breaks don't restart cell numbers , here is what I used, can anyone please help?

Sub AddHeaderToAll_FromEachSheet()
'Add A1 from each sheet to that sheet's header
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.PageSetup.LeftHeader = ws.Range("A1").Value
Next ws
End Sub
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Watch MrExcel Video

Forum statistics

Threads
1,098,847
Messages
5,465,070
Members
406,411
Latest member
Xiaoming

This Week's Hot Topics

Top