Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
With more than 35 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.
Learn more about Allen...
You may find it helpful to sometime place the contents of a cell into the footer of a worksheet, and to have the footer updated every time the contents of the cell changed. The easiest way to do this is with a macro. The following is an example of a macro that will place the contents of cell A1 into the left side of the footer:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) ActiveSheet.PageSetup.LeftFooter = Range("A1").Text End Sub
The macro is run every time Excel does its normal recalculation—meaning every time the contents of any cell changes or someone presses F9. If you want the contents to be in a different part of the footer, you can change LeftFooter to CenterFooter, or RightFooter.
To apply any formatting to the footer other than the default you will need to add special formatting codes, and you can also use special data codes that Excel recognizes for headers and footers. Both the special formatting and special data codes are quite lengthy and have been covered in other issues of ExcelTips.
If you are working with a very large worksheet, then changing the footer every time Excel recalculates may unnecessarily slow down your computer. After all, the footer remains invisible to the user until such time as the worksheet is actually printed. In this case, you simply need to rename the above macro to some other name that you would then manually execute as the last step before printing a worksheet.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2522) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003
You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Putting Cell Contents in Footers.
A Picture is Worth Thousands! Your worksheets are not limited to holding numbers and text. You can also add graphics or easily create charts based on your data. Excel Graphics and Charts, available in two versions, helps you make your graphics and charts their absolute best. Check out Excel Graphics and Charts today!