Excel-Footer Mass change of only Header and not footer

M

M.Raguram

In Excel, there are 20 worksheets with independent header
and footers defined.

Now I need to change only header en-mass and without
changing the footer. When I try to change the header by
selecting multiple worksheets and change the header, the
footer of the main page gets applicable to all sheets.

Can we change only header at one-go and not the footer.
 
D

Debra Dalgleish

You could change the headers programmatically:

'==================================
Sub ChangeHeader()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = "&D"
.CenterHeader = ""
.RightHeader = "&F"
End With
Next ws
End Sub
'====================================
 

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