Consulting

Results 1 to 10 of 10

Thread: Solved: Formula to return totals of printed pages

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Solved: Formula to return totals of printed pages

    Hi

    On the attached sheet I'm trying to figure out a formula that will return the sum of the cells below, but only the cells that will appear on a given printed page.

    Ideally, I'd like to be able to click 'print', and the entire document will be printed (with rows 1 - 3 appearing on each sheet with appropriate results).

    Rows in the main table can be inserted - and so I can't have fixed print page references.

    But I'd be happy to use a filtering system and print out a page at a time if I could have a formula that would return the page number.

    Any suggestions please?

    Cheers

    Sir BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    If you mean you want to use the 'Rows to repeat at top' option in Page Setup to have a total for each page when printed, then that won't work - you will just get the same information on each page. You would need to have a separate print routine that printed each page individually and calculated the relevant information, probably putting it in the header or footer as appropriate. (if Access is an option, it would be a piece of cake in a report)
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Quote Originally Posted by rory
    If you mean you want to use the 'Rows to repeat at top' option in Page Setup to have a total for each page when printed, then that won't work - you will just get the same information on each page. You would need to have a separate print routine that printed each page individually and calculated the relevant information, probably putting it in the header or footer as appropriate. (if Access is an option, it would be a piece of cake in a report)
    OK thanks Rory

    What about a UDF to return a page number in each cell in, say, column A (1 - 300)? Is there such a thing? Cos then I can use Subtotal and print one filtered page at a time.

    Thanks
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  4. #4
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    How's this - it uses defined names and Excel 4 macro functions.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Rory,

    My apologies for not getting back sooner. This is great, it'll do just fine.

    Thanks for your time on this

    Sir BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Rory,
    Just came across this post. Can you point me to a source of Excel 4 macro functions?
    Regards
    Malcolm
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Malcolm,

    Do a search for macrofun.hlp
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Hello Malcom ,

    Should be quit by now, but saw your request and in case you don't already have, thought you might like this (help file (.chm)) that I found somewhere in Microsoft's KB or MSDN or ???

    Anyways, hope useful,

    Mark

  9. #9
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    Malcolm,
    I think you can still get it from here.
    Regards,
    Rory

    Microsoft MVP - Excel

  10. #10
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by GTO
    Hello Malcom ,

    Should be quit by now, but saw your request and in case you don't already have, thought you might like this (help file (.chm)) that I found somewhere in Microsoft's KB or MSDN or ???

    Anyways, hope useful,

    Mark
    I haven't seen that version before, but it is good, better layout than the version that I have.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •