PDA

View Full Version : print rows 2,3, as headers on page if multiple pages



wilg
06-24-2011, 11:49 AM
I have a spreadsheet that has a heading in rows 2 & 3, with varoius date in the rows below. I would like to know if there is a way to print thoes 2 rows at the top of each page. My data can range from 250 rows to 400 using differnt amounts of pages.

I am already using the "Header" function for a title that print's at the top of each page. I just want the information in the 2 rows to print at the top of each page.

Any thoughts?

CatDaddy
06-24-2011, 12:16 PM
Sub InsertHeaders()
Dim i As Integer
With ActiveWorkbook
For i = 2 To Sheets.Count
Sheets(1).Select
Rows("2:3").Select
Selection.Copy
Sheets(i).Select
Selection.Insert Shift:=xlDown
Next i
End With

End Sub

wilg
06-24-2011, 12:21 PM
This will permanently alter my sheets, and from what I understand will only do this on the second sheet. My worksheet may have anywhere from 2 to 5 sheet.

Any other way I maybe this could be reversed after?

Or print setup includes rows 2 & 3 on each page?

wilg
06-24-2011, 12:25 PM
Just found the answer to my question..

http://www.lytebyte.com/2009/08/18/how-to-print-first-row-or-header-row-on-every-page-in-excel/

But thank you for your suggestion - it poked my in the right direction.

CatDaddy
06-24-2011, 12:44 PM
so you didnt need code huh...btw the sheets.count portion is what would have cycled it through all of your sheets in a given workbook