+ Reply to Thread
Results 1 to 3 of 3

VBA to insert page breaks

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question VBA to insert page breaks

    Hi there,

    I am using the following code courtesy of xladept @: http://www.excelforum.com/excel-prog...int-macro.html

    Please Login or Register  to view this content.
    This macro simply inserts page breaks into the active worksheet.

    I need to be able to change the position of these page breaks such that my sheet prints more neatly!

    1. The current position of all the horizontal page breaks needs to be adjusted either up or down depending on the following.

    From the Horizontal Page break Row - Find what the Row number is of the next cell ABOVE the page break row & in Column 2, thats cell.value is like "*Crew*"
    Likewise do the same for BELOW who's cell value is also like "*Crew*"

    Determine which of these is the closer to the page break, and re-adjust the page break to the position of the found cell/row.

    This needs to be done for all the Page breaks on the worksheet

    Some help on this one would be really appreciated!

    Regards
    Jordan
    Last edited by jordan2322; 09-27-2012 at 10:40 PM. Reason: added line: This needs to be done for all the Page breaks on the worksheet

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

    Re: VBA to insert page breaks

    Hello jordan2322,

    Have you thought of using Word instead of Excel? It is far more flexible for page formatting than Excel is.
    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!)

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: VBA to insert page breaks

    Thanks for the Reply Leith.

    No I havnt, I have large amounts of rows which i wish to print, so im not sure word would be the most appropriate solution..?

    I wish to have this process fully automated, I think having to introduce word into the system would greatly complicate this task.

    Thanks for your suggestion tho!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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