Thursday, March 27, 2008

Create a Custom Header or Footer

Most of the time, the stock headers and footers available on the Header button's and Footer button's drop-down menus are sufficient for your report printing needs. Every once in a while, however, you may want to insert information not available in these list boxes or in an arrangement Excel doesn't offer in the readymade headers and footers.

Choose View => Worksheet Views => Page Layout View. Click Go To Footer to jump to the footer area.
In any desired header or footer section, type the text you want for the header (or footer). You can format the header and footer text just as you would any cell data. Click any options from the Header and Footer Elements group:

Page Number:
Insert a code that indicates the page number.

Number of Pages:
Insert a code that indicates the total number of pages.

Current Date or Current Time:
Insert the print date or time of day.

File Path, File Name, or Sheet Tab Name:
Include file information.

Picture:
Insert a graphic image such as a company logo.

Format Picture:
Resize, rotate, or crop a header or footer graphic image.

To use these command buttons in the Header & Footer Elements group to create a custom header or footer, follow these steps:

  1. Put your worksheet into Page Layout view by clicking the Page Layout View button on the Status bar or by clicking View | Page Layout View on the Ribbon or pressing Alt+WP.
    In Page Layout view, the text, Click to Add Header, appears centered in the top margin of the first page and the text, Click to Add Footer, appears centered in the bottom margin.

  2. Position the mouse pointer in the top margin to create a custom header or the bottom margin to create a custom footer and then click the pointer in the left, center, or right section of the header or footer to set the insertion and left-align, center, or right-align the text.
    When Excel sets the insertion point, the text, Click to Add Header and Click to Add Footer, disappears and the Design tab on the Header & Footer Tools contextual tab becomes active on the Ribbon.

  3. To add program generated information to your custom header or footer (such as the filename, worksheet name, current date, and so forth) click its command button in the Header & Footer Elements group.
    Excel inserts the appropriate header/footer code preceded by an ampersand (&) into the header or footer. These codes are replaced by the actual information (filename, worksheet name, graphic image, and the like) as soon as you click another section of the header or footer or finish the header or footer by clicking the mouse pointer outside of it.

  4. (Optional) To add your own text to the custom header or footer, type it at the insertion point.
    When joining program-generated information indicated by a header/ footer code with your own text, be sure to insert the appropriate spaces and punctuation. For example, to have Excel display the Page 1 of 4 in a custom header or footer, you do the following:

    1. <>
    2. Click the Page Number command button and press the spacebar again.
    3. Type the word of and press the spacebar a third time.
    4. Click the Number of Pages command button.
      This inserts Page &[Page] of &[Pages] in the custom header (or footer).

  5. (Optional) To modify the font, font size, or some other font attribute of your custom header or footer, drag through its codes and text and then click the Home tab and then click appropriate command button in the Font group.
    In addition to selecting a new font and font size for the custom header or footer, you can add bold, italics, underlining, and a new font color to its text with the Bold, Italic, Underline, and Font Color command buttons on the Home tab.

  6. After you finish defining and formatting the codes and text for your custom header or footer, click a cell in the Worksheet area to deselect the header or footer area.
    Excel replaces the header/footer codes in the custom header or footer with the actual information, while at the same time removing the Header and Footer Tools contextual tab from the Ribbon.

No comments: