+ Reply to Thread
Results 1 to 2 of 2

If within Three Rows of Page Break, Insert Blank rows

  1. #1
    Forum Contributor
    Join Date
    12-09-2015
    Location
    Virginia, USA
    MS-Off Ver
    2007
    Posts
    123

    If within Three Rows of Page Break, Insert Blank rows

    Hello,

    Looking for loop code that will look at each line of a worksheet and if the value in cell A (row 61, 121, 181, 241..+ 60) = "Header" then insert a row that just says "^^^". I am trying to prevent a table header from being the last row on a page and, if it is, to go ahead and push it down to the next page.

    Even better would be able to decipher if it is within 3 rows of row 61/121/181/etc to insert 4 lines to push it down, 2 rows within 61/121/181/etc insert 3 new rows, 1 row within 61/121/181/et, insert 2 new rows.

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: If within Three Rows of Page Break, Insert Blank rows

    see if this works for you

    Please Login or Register  to view this content.
    Last edited by k1dr0ck; 03-07-2023 at 12:20 AM.

+ 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. [SOLVED] Page break on visible rows with set amount of rows
    By gizmo1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2022, 02:39 PM
  2. Insert Page Break In Blank Row Above Data Sets
    By AndyM87 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-11-2015, 09:35 AM
  3. Need VBA Code to Ignore Hidden Rows Page Break (Rows Grouped/Ungrouped)
    By Photosweet2006 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 11:48 AM
  4. [SOLVED] Insert Page breaks automaticaly in blank rows
    By smoothit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2014, 05:04 PM
  5. [SOLVED] Trying to use a Macro to insert a page break every 50 rows starting with row 2.
    By Kashikoi09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2014, 02:12 PM
  6. 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
  7. Replies: 1
    Last Post: 10-10-2005, 07:05 AM

Tags for this Thread

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