Printing tables in Excel is a common task for many people, especially those who work with data on a regular basis. One of the issues that often arises when printing tables in Excel is the need to repeat the table’s header row or column on each printed page. This is important because it makes it easier to read and interpret the table, particularly if it contains a large number of rows or columns. Fortunately, Excel offers several ways to repeat headers on each printed page. In this article, we’ll explore some of the best methods for doing so.
Method 1: Using the Print Titles feature
The Print Titles feature in Excel allows you to specify rows or columns that should be repeated on each printed page. This makes it an ideal solution for tables with a header row or column that needs to be repeated. Here’s how to use the Print Titles feature:
- Select the range of cells that includes the header row or column.
- Click on the Page Layout tab in the Excel ribbon.
- Click on the Print Titles button in the Page Setup group.
- In the Page Setup dialog box, click on the Sheet tab.
- In the Rows to repeat at top field, click on the Collapse Dialog button and select the row(s) that you want to repeat.
- In the Columns to repeat at left field, click on the Collapse Dialog button and select the column(s) that you want to repeat.
- Click OK to close the Page Setup dialog box.
That’s it! Now, when you print your table, the specified header row or column will be repeated on each printed page.
Method 2: Using a Macro
If you need to repeat headers on each printed page frequently, you might want to consider using a macro instead of the Print Titles feature. A macro is a series of commands that can be recorded and played back later. Here’s how to create a macro to repeat headers:
- Press Alt+F11 to open the Visual Basic Editor.
- Click on Insert > Module to create a new module.
- Copy and paste the following code into the module:
- Replace “$1:$1” with the range of cells that includes your header row.
- Save and close the module.
- Switch back to Excel and select the table that you want to print.
- Click on the Developer tab in the ribbon.
- Click on the Macros button in the Code group.
- Select the PrintHeaders macro and click on Run.
Sub PrintHeaders()
ActiveSheet.PageSetup.PrintTitleRows = "$1:$1"
ActiveSheet.PageSetup.PrintTitleColumns = ""
End Sub
Now, each time you run the PrintHeaders macro, the specified header row or column will be repeated on each printed page.
FAQ
Q: Can I change the font and formatting of the repeated headers?
A: Yes, you can change the font and formatting of the repeated headers just like you would for any other text in Excel. To do so, simply select the header row or column and apply the desired font, font size, and formatting using the Home tab in the ribbon.
Q: Will the repeated headers appear on every page regardless of the print area?
A: No, repeated headers will only appear on pages that contain data from the specified range of cells. If you have set up a print area that does not include the header row or column, the headers will not be repeated on those pages. To ensure that the headers appear on every page, make sure that the print area includes the entire range of cells that you want to print, including the header row or column.
Video Tutorial
In summary, repeating headers on each printed page is an important task for anyone who works with tables in Excel. Fortunately, Excel offers several ways to do so, including using the Print Titles feature and creating macros. By using these methods, you can ensure that your tables are easy to read and interpret, even if they contain a large amount of data.