+ Reply to Thread
Results 1 to 2 of 2

Page Breaks to avoid splitting groups

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Page Breaks to avoid splitting groups

    Hey Everyone,

    First post to this forum...Looks like a pretty nice site!

    So I have a timesheet page in MS Excel 2010 that can have 40 to 1000 lines (depending on the amount of jobs the employees worked on). I am wanting to automate setting page breaks to avoid an employee block from being split on to 2 separate sheets (which happens all the time).

    I think the easiest part of this is the last line of each employee block has the value "Sum" in column "A", but the last line of a page almost never falls on line 69.(Imagine that!)

    As it sits now, there is no text wrapping and row height is all equal and I'm getting 69 lines per page.

    Anyone give some insight on vba to help set page breaks after the last "Sum" value in column "A" that does not run to the next page?

    Thanks in advance Guys,
    Vince

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Page Breaks to avoid splitting groups

    You can assign HPageBreaks based on the value of Range.Height. Get the row number for "SUM" rows & then compute the height to see if you can fit data for 1, 2 or 3 employees completely; & assign HPageBreaks accordingly.

    Good luck
    - Jewel

+ 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. Printing Groups of Data together with Smart Page Breaks
    By Spike8754 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 06:06 PM
  2. Replies: 3
    Last Post: 12-15-2011, 09:40 PM
  3. Replies: 1
    Last Post: 03-15-2009, 06:08 PM
  4. Hard page breaks being replaced by soft breaks in the wrong place
    By JDavies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2008, 10:28 AM
  5. Splitting Cells with Line Breaks
    By homersf in forum Excel General
    Replies: 3
    Last Post: 03-13-2008, 01:06 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