+ Reply to Thread
Results 1 to 4 of 4

Print page only if subtotal has a value

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Print page only if subtotal has a value

    I apologise if this should be two posts instead of one - please let me know if it should be. I have a 60,000 row 10 column spreadsheet that needs to be split at changes in text in col "c". This generally happens every 8 - 30 rows so the number of resulting pages is large.

    I have tried MANY macros to do this but using Excel 2010 I ALWAYS crash on a line of code that contains xlPageBreakManual.
    (When running this code I select the cell below the first row of data and all active cells below.)

    e.g.
    Please Login or Register  to view this content.
    (or really anything with 'xlPageBreakManual'). Because of this I have bypassed the macro side of things and used the subtotal function to create the page breaks.

    What I would like to do now is print ONLY those pages where the subtotal >0.

    I have attached an example spreadsheet. is there a way of printing ONLY the pages that have a subtotal >0. Also, if there is a macro that can put the page breaks in instead of using the subtotals function that would also be great. The reason being - running the subtotal function over 60,000 lines is prohibitively slow or crashes the computer completely.

    thanks
    Attached Files Attached Files
    Last edited by SillySox; 03-06-2013 at 11:01 PM. Reason: added example spreadsheet

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Print page only if subtotal has a value

    Try this

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-10-2013
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Print page only if subtotal has a value

    Thanks for this - seems to fail at

    #ActiveSheet.PageSetup.PrintArea = pArea#

  4. #4
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Print page only if subtotal has a value

    i ran it and no errors...if you want send the file..but you should be able to figure it out from there

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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