+ Reply to Thread
Results 1 to 7 of 7

Put two chosen ranges on two different pages of one PDF document

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    26

    Put two chosen ranges on two different pages of one PDF document

    Dear All,

    Below you can find the code that I've written out in order to get a PDF copy of a chosen range from my excel worksheet. Could anyone tell me how they would adjust the code so that instead of having one single page with the two ranges, I could have 1 range on the first page of a PDF and the second range on the second page of that same PDF. (i.e. the PDF would have 2 pages with one range on each page.)
    The execution is made via a command button (Button13_Click)
    The two ranges would go from range1(A1:K77) and range2(A78:K196)


    Please Login or Register  to view this content.
    Thank you for your help!

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Put two chosen ranges on two different pages of one PDF document

    Hi bobby.bobby

    Try inserting a Page Break in the Worksheet at A78.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Put two chosen ranges on two different pages of one PDF document

    Hey Jaslake,

    Thanks for replying. Ideally I would want to do it through VBA coding, is there really no other way of doing it through coding?

    Thanks again.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Put two chosen ranges on two different pages of one PDF document

    Hi bobby.bobby

    Did manually inserting a Page Break in the Worksheet at A78 work?

    If so, insert a Page Break in the Worksheet at A78 WITH Code.

  5. #5
    Registered User
    Join Date
    01-10-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Put two chosen ranges on two different pages of one PDF document

    Hey Jaslake,

    In the code written above, where would you include the VBA Coding to create the Page Break?

    I'm struggling to see where it would ideally be placed

    Thanks

  6. #6
    Registered User
    Join Date
    01-10-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Put two chosen ranges on two different pages of one PDF document

    something like this, no?

    ActiveSheet.HPageBreaks.Add Before:=Range("A77")

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Put two chosen ranges on two different pages of one PDF document

    Hi bobby.bobby

    Did this work???
    ActiveSheet.HPageBreaks.Add Before:=Range("A77")
    If not I'll be happy to look at it...please post your Workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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