+ Reply to Thread
Results 1 to 6 of 6

Set Page Breaks to 36 rows and find last row in column J

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Set Page Breaks to 36 rows and find last row in column J

    Hi All,

    I am having trouble with getting this code to work properly, not sure how to fix it.

    I need to do 2 things on a Sheet that will constantly have a changing amount of rows so that the printable area is as follows:

    1. set the Page Breaks to 36 rows
    2. set the bottom of the print area to the last row of data for range A:L based on the lowest row of data in column J.

    This is my code, what am I doing wrong?

    Please Login or Register  to view this content.
    Thanks,
    Brendan

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Set Page Breaks to 36 rows and find last row in column J

    You didn't describe the problem, however:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Set Page Breaks to 36 rows and find last row in column J

    Thanks for your reply! Your code works (I have adjusted it slightly as per below) except I am getting a small page that doesn't adhere to the rule as per below image.

    Capture.PNG

    Please see attached example workbook.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Set Page Breaks to 36 rows and find last row in column J

    How about this.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Set Page Breaks to 36 rows and find last row in column J

    Perfect! Thanks bakerman2

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Set Page Breaks to 36 rows and find last row in column J

    Ben did all the hard work but glad to help anyway.
    Thanks for rep+.

+ 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. Insertng Manual page breaks in set Rows
    By hans302 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2017, 04:55 PM
  2. VBA Code to set page breaks every 50 rows
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2014, 11:17 AM
  3. Page breaks and merged rows
    By jlt199 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2013, 12:26 PM
  4. Set page breaks at specific rows?
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2010, 11:13 PM
  5. Get Rows # by H page breaks!?
    By dccdvb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2009, 11:08 PM
  6. Replies: 1
    Last Post: 03-15-2009, 06:08 PM
  7. [SOLVED] find automatic page breaks
    By Reason in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2005, 01:06 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