Consulting

Results 1 to 5 of 5

Thread: print rows 2,3, as headers on page if multiple pages

  1. #1
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location

    print rows 2,3, as headers on page if multiple pages

    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?

  2. #2
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
     
    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

  3. #3
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    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?

  4. #4
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Just found the answer to my question..

    http://www.lytebyte.com/2009/08/18/h...page-in-excel/

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

  5. #5
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •