+ Reply to Thread
Results 1 to 3 of 3

VBA for "rows to repeat at top" for different rows in worksheet

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    266

    VBA for "rows to repeat at top" for different rows in worksheet

    I have a workbook with multiple sheets in it, all with similar headers, but with the headers appearing on different rows. One common header is “Date From” that is in multiple sheets appearing in different rows, but all in the same column (Column A).

    I am looking for a macro that will loop through all the worksheets, find the word “Date From” in a cell in Column A, and make that row the “rows to repeat at top” option that is found under the “Print Titles” section of Excel.

    Code I have found so far is Sheets(i).PageSetup.PrintTitleRows = "$1:$1" for specifying row 1 as your row to repeat, just not sure how to use a variable to specify it. Any info is appreciated.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: VBA for "rows to repeat at top" for different rows in worksheet

    Try


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    266

    Re: VBA for "rows to repeat at top" for different rows in worksheet

    Thanks. Looks good.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 09-21-2013, 03:18 AM
  2. Copy rows between "STARTCOPY" & "ENDCOPY" and insert in another worksheet
    By mikeop99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2013, 10:19 PM
  3. Replies: 2
    Last Post: 03-02-2013, 01:34 AM
  4. "Rows to Repeat at Top" Does Not Save
    By lloyddd in forum Excel General
    Replies: 1
    Last Post: 11-05-2007, 11:19 PM
  5. [SOLVED] "Rows to repeat at top" option under page setup
    By PaulandArt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2005, 10:15 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1