Copying Headers or Footers within a Workbook

Written by Allen Wyatt (last updated July 15, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Ross has an existing workbook that contains 36 worksheets. On the first worksheet he set up the footers the way that he wants. Ross wonders if there is an easy way to copy the footers from that first worksheet to all the other worksheets in the workbook.

It is very easy to do this in Excel. All you need to do is to follow these steps:

  1. Select your first worksheet, the one that has the headers and footers just the way you want.
  2. Now, in the worksheet tab area at the bottom of the Excel window, hold down the Shift key as you click on the tab for the last worksheet you want to affect. You've now created a selection set of worksheets, and your first worksheet should still be the active one. (You can tell this because it has the green underline on the tab itself.) (See Figure 1.)
  3. Figure 1. A selection set of worksheet tabs.

  4. Display the Page Layout tab of the ribbon.
  5. Click the small icon at the bottom-right of the Page Setup group. Excel displays the Page Setup dialog box.
  6. Make sure the Header/Footer tab is displayed. The headers and footers shown in the dialog box should reflect those of the active worksheet, which is the worksheet you first selected in step 1.
  7. Click OK. All of the worksheets you selected in step 2 are still selected.
  8. Click any worksheet tab other than the active one (the one that has the green underline). This cancels your selection set.

That's it; the headers and footers from the active worksheet are copied to all the worksheets you selected. Any previous headers and footers on the selected worksheets are overwritten in the process.

The key to success in these steps is to make sure that the active worksheet is the one that has your desired headers and footers. This is the worksheet that you should have selected in step 1 and the one that has the green underline on the worksheet tab, as described in step 2. It is that worksheet's headers and footers you should see on the Header/Footer tab of the Page Layout dialog box in step 5. (If you don't see the proper headers and footers in step 5, you should immediately press Esc or click on Cancel in the dialog box so you don't copy the headers and footers.)

If you want to only copy footers (and leave headers as they are, which Ross seems to desire), then you will need to resort to using a macro. Here's a simple macro that will handle any text in the footers only:

Sub CopyFooters()
    Dim wSource As Worksheet
    Dim sSourceName As String
    Dim bFP As Boolean
    Dim bEP As Boolean
    Dim wSFP As Object
    Dim wSEP As Object
    Dim w As Worksheet

    Set wSource = ActiveWorkbook.Worksheets("Sheet1")
    sSourceName = wSource.Name
    Set wSFP = wSource.PageSetup.FirstPage
    Set wSEP = wSource.PageSetup.EvenPage

    With wSource.PageSetup
        bFP = .DifferentFirstPageHeaderFooter
        bEP = .OddAndEvenPagesHeaderFooter
    End With

    For Each w In ActiveWorkbook.Worksheets
        With w.PageSetup
            .DifferentFirstPageHeaderFooter = bFP
            .OddAndEvenPagesHeaderFooter = bEP

            .LeftFooter = wSource.PageSetup.LeftFooter
            .CenterFooter = wSource.PageSetup.CenterFooter
            .RightFooter = wSource.PageSetup.RightFooter

            If bFP Then
                With .FirstPage
                    .LeftFooter.Text = wSFP.LeftFooter.Text
                    .CenterFooter.Text = wSFP.CenterFooter.Text
                    .RightFooter.Text = wSFP.RightFooter.Text
                End With
            End If

            If bEP Then
                With .EvenPage
                    .LeftFooter.Text = wSEP.LeftFooter.Text
                    .CenterFooter.Text = wSEP.CenterFooter.Text
                    .RightFooter.Text = wSEP.RightFooter.Text
                End With
            End If
        End With
    Next w
End Sub

If you examine the code closely, you'll note that there is a difference in how the footer contents are referenced based on whether the footer is a regular footer, a first-page footer, or an even-page footer. Specifically, the non-regular footers use the .Text property, whereas the regular footers don't. This is because (apparently) VBA defaults to using the .Text property when you are using the .LeftFooter, .CenterFooter, and .RightFooter properties of the .PageSetup object. However, if you use those same footer properties with either the .FirstPage or .EvenPage objects, then the .Text property is not assumed—it must be specifically stated. Without it being specified as shown here, the macro will crash.

If you want to use the macro, all you need to do is to make sure the "Sheet1" reference is changed to the name of the worksheet from which you want to copy the footers.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13902) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Quickly Changing Tab Alignment

Need to change the alignment of some tabs in a multitude of paragraphs? How you approach the problem depends on whether ...

Discover More

Viewing Footnotes

Adding footnotes to a document is essential for some types of writing. How you view those footnotes depends on the ...

Discover More

Shortcut to Enter GMT

Entering the current time into a cell is easy, as Excel provides a built-in shortcut to accomplish the task. Here's a ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Setting Header/Footer Margins

Do you find that there is a lot of extra space around the data on your worksheet when it is printed? Changing the margins ...

Discover More

Date Last Edited

When adding headers or footers to your worksheets, you may want to include the date that the workbook was last edited. ...

Discover More

Changing Section Headers

Add subtotals to a worksheet and you can instruct Excel to start each new subtotal section on a new printed page. You may ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2023-07-19 09:54:25

J. Woolley

My Excel Toolbox includes the following function to put Text in a worksheet's headers or footers, which makes them dynamic instead of static:
For a complete description of this function, see
For additional discussion, see my comments here:
Also, see

2023-07-17 13:50:35

J. Woolley

After further consideration, perhaps you were referring to variable names in the Tip's macro instead of the version I posted below. Nevertheless, my most recent comment is still valid.

2023-07-17 10:38:47

J. Woolley

Here is one excuse for using variable names like bFP: When posting VBA to the Tips site, long variable names will cause statements to wrap to the next line, which makes them difficult to read. It is not easy to know where the statement will wrap because the font is not a fixed size (like Courier). I avoid more than 80 characters per line. And it is desirable to minimize the number of lines posted.
It is common (but not necessary) to use "b" as the first character for a Boolean variable or "s" for a String, etc. I chose bFP instead of bFirstPage. Maybe you can guess what bEP and the other variables represent.

2023-07-17 02:19:57


When I first started writing code, the Apple IIe had twin 5.25" floppy disk drives each with a capacity of 140k formatted. Microsoft Basic was designed for economy and a variable name was restricted to a single letter. This made debugging your own code difficult, never mind someone else's.

Enter the IBM-PC with disk capacity in the megabytes and programming languages like Turbo Pascal that allowed variable names of any length. There may have been a limit of 256 characters, but get serious. Quickly coders learned to make code self-commenting by assigning meaningful names to variables and subroutines.

There is no excuse for using cryptic variable names like bFP, unless it is your intention to confuse.

That apart, this macro has taught me a lot about page properties and how to access them. Thank you.

2023-07-15 10:54:18

J. Woolley

The Tip's macro unnecessarily copies footers from Sheet1 to Sheet1 (itself). Also, it should be noted that Sheet1 might not be first in the workbook's arrangement of sheet Tabs. If Ross wants to copy from the worksheet with the first Tab, here is a more efficient version of the Tip's macro:

Sub CopyFooters2() 'ignore FooterPictures
    Dim PS0 As PageSetup, PS1 As Object, PS2 As Object
    Dim bFP As Boolean, bEP As Boolean, n As Integer
    With Worksheets(1) 'copy from first worksheet Tab
        Set PS0 = .PageSetup
        With PS0
            bFP = .DifferentFirstPageHeaderFooter
            If bFP Then Set PS1 = .FirstPage
            bEP = .OddAndEvenPagesHeaderFooter
            If bEP Then Set PS2 = .EvenPage
        End With
    End With
    For n = 2 To Worksheets.Count 'copy to other worksheets
        With Worksheets(n).PageSetup
            .LeftFooter = PS0.LeftFooter
            .CenterFooter = PS0.CenterFooter
            .RightFooter = PS0.RightFooter
            .DifferentFirstPageHeaderFooter = bFP
            .OddAndEvenPagesHeaderFooter = bEP
            If bFP Then
             With .FirstPage
                    .LeftFooter.Text = PS1.LeftFooter.Text
                    .CenterFooter.Text = PS1.CenterFooter.Text
                    .RightFooter.Text = PS1.RightFooter.Text
                End With
            End If
            If bEP Then
                With .EvenPage
                    .LeftFooter.Text = PS2.LeftFooter.Text
                    .CenterFooter.Text = PS2.CenterFooter.Text
                    .RightFooter.Text = PS2.RightFooter.Text
                End With
            End If
        End With
    Next n
End Sub

Both macros ignore any Left/Center/RightFooterPicture (&[Picture]) as well as any chart sheets. To include chart sheets, substitute Sheets in place of Worksheets; there are 3 instances (ignoring comments). To copy headers instead of footers, substitute Header in place of Footer everywhere EXCEPT DifferentFirstPageHeaderFooter and OddAndEvenPagesHeaderFooter; there are 19 instances (ignoring comments).

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.