• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Excel in Practice

A common task in Excel is applying custom headers and footers to the current sheet or all sheets in a workbook. If you want a macro to apply headers and footers to all sheets, right-click a sheet tab, and choose Select All Sheets from the shortcut menu before you set the headers and footers. It's also a good idea to record deselecting all the sheets as part of the macro so that you don't have all of the sheets grouped when the macro stops playing. A quick way to deselect all sheets is to click the active sheet tab while pressing the Shift key. To record the macro, follow these steps:

  1. Turn on the macro recorder. Store this macro in the Personal Macro Workbook, and call it CustomHeaderFooter or something similar.

  2. Select all the sheets in the current workbook (see Figure 29.23).

    Figure 29.23. Select all the sheets using the Select All Sheets command from the sheet tab shortcut menu. This will apply the same headers and footers to all sheets in the workbook.

  3. Set the headers and footers using the File, Page Setup command from the menu (see Figure 29.24).

    Figure 29.24. Set the header and footer using the Custom Header and Custom Footer buttons in the Page Setup dialog box.

  4. Press and hold down the Shift key as you click the sheet tab for the active sheet.

  5. Stop the recorder.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint