top of page

Set Rows to Repeat at Top of Multiple Worksheets


If you right click on a worksheet in Excel, you'll be able to 'Select All Sheets' and perform many editing tasks on all worksheets simultaneously. However, under Page Layout . . . Page Setup . . .on the Sheet tab, you will not be able to enter a range in the Print titles section for, "Rows to repeat at top" - it is grayed out, disabled. This setting makes column headers in one or more rows, repeat on each page of a worksheet printed to a PDF or hard copy.

Gord Dibben posted Visual Basic code here which will allow you to designate a range of rows to be entered in the "Rows to repeat at top" field on all worksheet.

Press ALT + F11 to enter Visual Basic and enter the below vba code in a new module [right click on the workbook name in the project list and select Insert . . . Module]. Designate the rows on the line which begins, "ws.PageSetup.PrintTitleRows", preceding each row number with a dollar sign. Press play and the row range will be entered for each worksheet.

Sub test() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets 'For Each ws In ActiveWindow.SelectedSheets If ws.Type = xlWorksheet Then ws.PageSetup.PrintTitleRows = "$1:$3" End If Next End Sub


Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page