+ Reply to Thread
Results 1 to 3 of 3

Trying to use a Macro to insert a page break every 50 rows starting with row 2.

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    Saint Louis, MO
    MS-Off Ver
    Excel 2010
    Posts
    1

    Trying to use a Macro to insert a page break every 50 rows starting with row 2.

    I've tried this several times and I just cannot get it to work. I was able to use the below macro in a previous version of this document and it worked fine but in this one, it either doesn't work at all or I get a message saying that I can only enter 1024 page breaks. It is an insanely long spreadsheet but it worked before so I'm just wondering what I'm doing wrong here. Any help is appreciated!

    Here is what I used previously. The previous document did have the same amount of rows (223620).
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 02-21-2014 at 02:04 PM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Trying to use a Macro to insert a page break every 50 rows starting with row 2.

    See http://support.microsoft.com/kb/284916

    There is a limit of 1,026 page breaks per worksheet. You are trying to apply 4,384.

    As you want your page breaks to be equally spaced, why not just adjust your page scaling to fit by 4,384 pages high?
    Last edited by Olly; 02-21-2014 at 02:14 PM. Reason: Ooops - 1026, not 1024!
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Trying to use a Macro to insert a page break every 50 rows starting with row 2.

    Hello Kashikoi09,

    Welcome to the Forum!

    I am not sure why it worked the first time. Excel, depending on the version, only allows 1026 manual horizontal page breaks (See article here)
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. macro to insert page break when value in row changes
    By printroom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2013, 06:15 AM
  2. Insert blank row, sum and insert page break macro
    By kim5012 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-06-2012, 01:46 AM
  3. Create insert page break macro
    By qtam82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2012, 03:57 AM
  4. Macro To Loop And Insert a Page-break
    By SgtPb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2010, 12:04 PM
  5. Replies: 1
    Last Post: 10-10-2005, 07:05 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