+ Reply to Thread
Results 1 to 5 of 5

Create manual page breaks

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Create manual page breaks

    I have a bit of code that imports data into a single spreadsheet from text file. The imported data is broken into sections of rows according to the data type.

    As an example, data is layed out as follows once text file is imported:

    Row 01: Data related to Apples
    Row 02: Data related to Apples
    Row 03: Data related to Apples
    Row 04: Data related to Apples

    Row 05: Blank Row

    Row 06: Data related to Rasberries
    Row 07: Data related to Rasberries
    Row 08: Data related to Rasberries
    Row 09: Data related to Rasberries

    Row 10: Blank Row

    Row 11: Data related to Oranges
    Row 12: Data related to Oranges
    Row 13: Data related to Oranges

    If, for example, each page is able to hold only 11 rows of data, the data related to oranges is printed on two separate pages (row 11 is on page 1; rows 12 & 13 are on page 2).

    Is there any code I could use that would insert a manual page break at first blank row before the next page break (in this case row 11)? Thank you in advance for any comments.

  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: Create manual page breaks

    Hello maacmaac,

    Do you want to automatically insert a manual page break every 11th row?
    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
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: Create manual page breaks

    The 11th row was only an example. I actually want page breaks at every 39th row. The same rule applys as before.

    As an example, rows 35-42 are as follows:

    row 35: blank/empty row
    row 36: data related to apples
    row 37: data related to apples
    row 38: data related to apples
    row 39: data related to apples
    row 40: data related to apples
    row 41: data related to apples
    row 42: data related to apples

    It this instance, I would want to insert a page break just before row 36, not row 39. Thanks.

  4. #4
    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: Create manual page breaks

    Hello modytrane,

    This macro will insert a manual page break below each blank line.
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: Create manual page breaks

    Thanks for the code. Working fine but I am really trying to keep "groups" of data printed on same page. I should have explained a little better and attached a sample document.

    As example, data as follows:

    Rows 1 -7: data related to oranges
    Row 8: empty row
    Rows 9-16: data related to pears
    Row 17: empty row
    Rows 18-34: data related to rasberries
    Row 35: empty row
    Rows 36-42: data related to apples
    Row 43: empty row
    Rows 44-51: data related to plums
    Row 52: empty row

    Right now the spreadsheet is printing rows 1-39 on page 1; rows 40-78 on page2; and so on.

    From example, the first page break occurs at row 39. This is causing the data for "apples" to be printed on two different pages. I would desire to print rows 1-35 on page 1 and start the print on page 2 with row 36. Hope this explains it a bit better. I have attached example file if needed. Thanks.
    Attached Files Attached Files

+ 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