Consulting

Results 1 to 5 of 5

Thread: Excel SUBTOTAL Pagebreak in Word Document

  1. #1
    VBAX Regular
    Joined
    Apr 2019
    Posts
    14
    Location

    Excel SUBTOTAL Pagebreak in Word Document

    Hey guys,

    I have to transfer data we get from a customer in excel sheets into a word document with the help of VBA.

    My main problem now is that I have to make a subtotal at the page end and transfer the result to the next page of the word document so that it's clearer.

    Is there any code or way how I can do this, because I can't solve it at all.

    Greetings,
    Last edited by Paul_Hossler; 05-06-2019 at 07:13 AM.

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Example attachment file?
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Regular
    Joined
    Apr 2019
    Posts
    14
    Location

    further explanation

    Thanks for the reply,

    I made a table with 5 columns with dummy data (my original table has 8 columns) and I also added my invoice template in which the data should be transfered.

    If I have a excel table with a lot of rows my word document also goes over several pages. Therefore I need a subtotal of the total boxes and prices at the end of each page in the word document. The subtotal should then be transfered to the next word page so the remaining data can be added.
    I hope this more detailed explanation of my problem can help you to understand it.


    Greetings,
    Last edited by Jacob Hilderbrand; 05-07-2019 at 10:41 AM.

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Does the output product have to a Word document?

    What I would do is make another Excel workbook with the logo, footer and header words and formatting needed, populate the 'pages' with data, add the subtotals, and save as a PDF file

    It's IMHO a lot simpler to just stay in Excel and not try to integrate with Word

    Also, what column(s) need to have a subtotal?

    When does the subtotal reset to 0? Like "When ship date changes" reset to 0 and start subtotaling again
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Quote Originally Posted by vloneboy View Post
    My main problem now is that I have to make a subtotal at the page end and transfer the result to the next page of the word document so that it's clearer.
    Word has no facility for that, so it would have to be coded for your particular requirements. Moreover, as soon as you switch to a different print driver (e.g. because you change printers or you email the document to someone using a different one), the layout and, hence, the locations of all your nice sub-totals are liable to change. They could end up not being on the last line or even being on the first line of the next page. That's because, unlike Excel, Word uses info from the active printer driver to optimise the page layout.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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