Excel Header and Footers

Choc1209

New Member
Joined
Sep 9, 2019
Messages
2
I have an excel workbook with 6 worksheets. Each worksheet has a different header. Each week, I want to be able to change 4 of the worksheets footers without changing their headers. When I group the 4 worksheets and change the footer; it changes the headers too. Is there a way to change 4 of the worksheets footers without doing it one worksheet at a time and not changing the headers?
 

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.
Hi Choc1209 - If I understand your question correctly, what I did was select the 4 worksheet that you want to change. Then select the Page Layout mode which shows the headers and footers. Then make your changes to the footer (which should be replicated across all selected sheets), leaving the headers alone. Hope this helps.
 
Upvote 0
Choc1209 - I see what you mean. My previous suggestion I don't think works. You might try something like the code below. Hope that helps.

Code:
Sub SameHeadersDifferentFooters()

    Sheets("Sheet1").Select
    With ActiveSheet.PageSetup
        .CenterHeader = "Same"
        .CenterFooter = "Different11"
     End With
    Sheets("Sheet2").Select
    With ActiveSheet.PageSetup
        .CenterHeader = "Same"
        .CenterFooter = "Different12"
     End With
    Sheets("Sheet3").Select
    With ActiveSheet.PageSetup
        .CenterHeader = "Same"
        .CenterFooter = "Different13"
     End With
    Sheets("Sheet4").Select
    With ActiveSheet.PageSetup
        .CenterHeader = "Same"
        .CenterFooter = "Different14"
     End With
End Sub
 
Upvote 0
Excel > Alt + F11 > insert module

Code:
Sub SameHeadersDifferentFooters()
Sheets("Sheet1").PageSetup.CenterHeader = "Same"
Sheets("Sheet1").PageSetup.CenterFooter = "Different11"
Sheets("Sheet2").PageSetup.CenterHeader = "same"
Sheets("Sheet2").PageSetup.CenterFooter = "Different12"
Sheets("Sheet3").PageSetup.CenterHeader = "Same"
Sheets("Sheet3").PageSetup.CenterFooter = "Different13"
Sheets("Sheet4").PageSetup.CenterHeader = "Same"
Sheets("Sheet4").PageSetup.CenterFooter = "Different14"
End Sub
 
Upvote 0
Is there a way to change 4 of the worksheets footers .... and not changing the headers?
Welcome to the MrExcel board!

Another code to try. Further detail on implementation ..
1. With your workbook active press Alt+F11 to bring up the vba window.
2. In the Visual Basic window use the menu to Insert|Module
3. Copy and Paste the code below into the main right hand pane that opens at step 2.
4. Close the Visual Basic window.
5. Press Alt+F8 to bring up the Macro dialog
6. Select the macro & click ‘Run’
7. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm)

Code:
Sub Change_Footers_Only()
  Dim ws As Worksheet
  
  For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet4", "Sheet6"))
    ws.PageSetup.CenterFooter = "New Footer"
  Next ws
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top