Results 1 to 5 of 5

Add page break after every 48th rows + border after last row on page

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-06-2017
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    123

    Add page break after every 48th rows + border after last row on page

    Hello all,

    Since 3 hours I am trying to do a small macro that will add a page break after every 48th row and a border after the last row in page, but it seems that it just doesn't work...

    I also tried to add the page break manually (macro recorder)

    ActiveSheet.ResetAllPageBreaks
    Set ActiveSheet.HPageBreaks(1).location = Range("A48")
    Set ActiveSheet.HPageBreaks(2).location = Range("A96")
    Set ActiveSheet.HPageBreaks(3).location = Range("A144")

    but since my number of pages are not always the same, it gives me an error when the range with data is shorter then the row number on vba...

    Any chance you can help?
    Last edited by lofgren; 03-18-2021 at 02:52 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding border at first page break
    By maym in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2018, 06:15 AM
  2. [SOLVED] Border Line at Page Break
    By jtmeunier in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-26-2013, 07:44 PM
  3. Page break border issue
    By chaddug in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2013, 11:34 AM
  4. [SOLVED] Page Layout (Page Break Preview) is not working with hidden rows in excel.
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2013, 03:32 AM
  5. Border In Each Page Break
    By dccdvb in forum Excel General
    Replies: 9
    Last Post: 06-10-2009, 11:10 PM
  6. [SOLVED] Conditional page break if merged rows won't fit on the page.
    By zbprtal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-12-2006, 04:00 PM

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