+ Reply to Thread
Results 1 to 6 of 6

Set print area for a dynamic range and launch print dialog

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Adelaide, South Australia
    MS-Off Ver
    Excel 2010
    Posts
    36

    Set print area for a dynamic range and launch print dialog

    I have a workbook with multiple worksheets containing a template "Statement of Account"

    Records are entered on each row until the last entry for the month.

    The columns range is static but I want to define the print area only to the last entry on the last row.

    B12 to M last row.

    The "Header" is already defined in the rows to repeat page setup.

    I would like to set a dynamic print range based on the last row and launch the print dialog to print to CutePDF.

    I would like to be able to apply this VBA code to the "active sheet" so the user doesn't have to define which sheet is to be printed.

    Any help will be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Set print area for a dynamic range and launch print dialog

    something like this maybe?

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Set print area for a dynamic range and launch print dialog

    oh i just noticed you wanted to go to print dialog...may i ask why?

  4. #4
    Registered User
    Join Date
    08-13-2012
    Location
    Adelaide, South Australia
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Set print area for a dynamic range and launch print dialog

    thank you Humdingaling

    After the print area has been defined i'd like to launch the print dialog so the user can select CutePDF from the printer selection. then they will save the CutePDF file to the nominated folder.

    Is this something you can assist with in VBA code?

    That is, automatically select CutePDF as the format after the print area has been defined, then ask the user which folder they wish to save the file to?

    Kind regards

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Set print area for a dynamic range and launch print dialog

    in that case this should do
    Please Login or Register  to view this content.
    ^a lot of clicking by the user in this one

    if you can manage without cutepdf but rather use the inbuilt pdf creator
    the first code automatically saves a pdf into the same folder the macro is in
    if you have placed the macro into your Personal.xlsb and want it to save into the ActiveWorkbook instead
    just change this ThisWorkbook.Path to Activeworkbook.path

    Please Login or Register  to view this content.
    Last edited by humdingaling; 05-18-2017 at 12:21 AM. Reason: grammar

  6. #6
    Registered User
    Join Date
    08-13-2012
    Location
    Adelaide, South Australia
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Set print area for a dynamic range and launch print dialog

    Thank you so much! your help is very much appreciated.

+ 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. how to print using combobox and make dynamic range of a print area
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2014, 07:26 AM
  2. Set print area of selected range then print preview if ok then print the document!
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 07:10 AM
  3. Code and Formula to print dynamic print area ranges
    By stpeter in forum Excel General
    Replies: 1
    Last Post: 10-15-2013, 03:33 PM
  4. Replies: 1
    Last Post: 09-05-2013, 03:32 AM
  5. [SOLVED] Need ‘Set Print Area’ Code for Dynamic Print Range based on Conditions
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 12:13 PM
  6. Replies: 2
    Last Post: 01-04-2013, 04:22 PM
  7. VBA to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM

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