repeat rows for add'l pages for tabs on a multi-tab worksheet

G

Guest

I have a worksheet with multiple tabs. Each of these tabs is a project and
some are more than 1 page. I'd like to get the rows to repeat on the
additional pages of these reports. Currently, when I "Select All Sheets" the
option to select "Rows to repeat at top" is greyed out.

How can I format this to get the rows to repeat when their are multiple pages?
 
D

Dave Peterson

Do it one worksheet at a time.
I have a worksheet with multiple tabs. Each of these tabs is a project and
some are more than 1 page. I'd like to get the rows to repeat on the
additional pages of these reports. Currently, when I "Select All Sheets" the
option to select "Rows to repeat at top" is greyed out.

How can I format this to get the rows to repeat when their are multiple pages?
 
G

Gord Dibben

Nancy

As you have found out, you cannot do this with "grouped" sheets.

You need a macro.

Sub repeat_at_top()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.PrintTitleRows = "$1:$3"
.PrintTitleColumns = ""
End With
Next ws
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top