+ Reply to Thread
Results 1 to 12 of 12

Need help with dynamic page breaks.

  1. #1
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Need help with dynamic page breaks.

    Hi
    The result I need is in column LV and was manually entered.

    Column LW are groups of matching numbers and each group is separated by a decimal number.
    The groups will change size.

    LV and LW are helper columns and my goal is to print sheets without breaking a group of numbers.

    Each sheet is 56 rows.
    The count in LU will try to reach 56 but it cant end in the middle of a group of matching numbers in LW.
    The count always ends at a decimal number. The next row will start at 1 again

    Every number 1 will represent a page break. I have the code that will put a page break at each number 1

    In my example, the count stopped at 48 and the next row started at 1 again.

    Boy I tried hard to have this make sense.

    I would prefer formulas but VB is ok!

    File attached

    I appreciate you!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-17-2007
    Location
    Tasmania, Australia
    MS-Off Ver
    2019, 365(v2310)
    Posts
    366

    Re: Need help with dynamic page breaks.

    What about in Cell LV4 and copied down
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    Hi
    The formula is appearing as text when I paste in LV
    weird

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Need help with dynamic page breaks.

    Are you sure? Change the formatting to number - does the number now have decimal places? If so, then it IS a number.

    If not, try:

    =--MOD(ROW()-ROW($A$4),48)+1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    I typed it in and it worked. The results look good. I'm going to try a few things and get back to you.

  6. #6
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    I see that it seemed to work because of the static value of 48. The formula needs to be dynamic as the values in LW are never the same.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Need help with dynamic page breaks.

    How about an updated sample workbook showing (a) the issue and (b) the expected results?

  8. #8
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    I did attach an example in my original post but not with the results from the formula. I can do that.

  9. #9
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    Hows this Ali.I appreciate your pointers!
    I edited uploaded Examples 3.1.
    I made a mistake in the notes. Column LW is never the same size of group numbers.
    Attached Files Attached Files
    Last edited by Russk68; 02-29-2024 at 07:31 PM. Reason: Mistake in notes

  10. #10
    Valued Forum Contributor
    Join Date
    10-17-2007
    Location
    Tasmania, Australia
    MS-Off Ver
    2019, 365(v2310)
    Posts
    366

    Re: Need help with dynamic page breaks.

    From your last attachment, I am not entirely sure how it is 'incorrect'. You have 4 columns LT:LW
    LT(orange) - marked Incorrect
    LU(blue) - Suggested Formula is marked 'incorrect'
    LV(green) - 'Correct'
    LW(black) - helper column

    LU and LV are exactly the same. Not sure exactly what is wrong. How about uploading the actual spreadsheet(removing sensitive data)

  11. #11
    Registered User
    Join Date
    07-15-2007
    Location
    NJ
    Posts
    23

    Re: Need help with dynamic page breaks.

    Hi russkris
    My apologies as I uploaded the wrong file.
    Column LW always changes so a formula with static criteria will not work. I attached the new file with different results in LW and you can see that the blue column did not change.
    Uploading the actual file will just make it more confusing.

    I appreciate your time!
    Attached Files Attached Files
    Last edited by Russk68; 03-01-2024 at 01:12 AM. Reason: Mistake in file

  12. #12
    Valued Forum Contributor
    Join Date
    10-17-2007
    Location
    Tasmania, Australia
    MS-Off Ver
    2019, 365(v2310)
    Posts
    366

    Re: Need help with dynamic page breaks.

    So each 'batch' stops at the decimal numbers?

    What about something like
    Please Login or Register  to view this content.
    Last edited by russkris; 03-01-2024 at 01:25 AM.

+ 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. Page breaks in spreadsheet do not page breaks that I insert.
    By tfurnivall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-08-2023, 09:52 PM
  2. Replies: 1
    Last Post: 06-28-2017, 11:28 AM
  3. VBA code and Adding dynamic Page Breaks
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2016, 03:11 PM
  4. Clear all page breaks, then insert new breaks at change in data
    By Alex0929 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2014, 03:12 PM
  5. Dynamic Page breaks with repeated row
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2012, 04:45 PM
  6. Replies: 1
    Last Post: 03-15-2009, 06:08 PM
  7. 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

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