All sheets in workbook have same rows to repeat at top

S

Subodh

I want to repeat the same rows (Rows 1 to 3) from a worksheet say
Sheet1 when printing any sheet
of the workbook.
When I try to do that I cannot select multiple sheet at the same time.
I also tried to select all the sheets and then try with the printing
command.
This also didn't work. It appears that this is a sheet only property.
Is there a way around.
Thanks in advance.
 
G

Gord Dibben

You need VBA to achieve this.

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

NOTE: this will select rows 1:3 of each Sheet, not rows 1:3 of Sheet1
I want to repeat the same rows (Rows 1 to 3) from a worksheet say
Sheet1 when printing any sheet

If you wanted 1:3 of Sheet1 to print on other sheets you would have to copy
those rows to each sheet.


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