+ Reply to Thread
Results 1 to 8 of 8

Set print area and save as pdf

  1. #1
    Registered User
    Join Date
    02-07-2014
    Location
    Brisbane
    MS-Off Ver
    Excel 2013
    Posts
    6

    Set print area and save as pdf

    Hi guys,

    I would like to have a command button to do the following command:

    1. Check on sheet "FM017" the following cells for value 0 and 1:
    AK31
    AK53
    AK84
    AK106
    AK137
    AK157
    AK190
    AK212
    AK243
    AK265
    AK296
    AK318
    AK349
    AK371
    AK402
    AK424
    AK455
    AK477
    AK508
    AK530

    2. Set print area from A1 to "last cell with value 0" (which will be one of the listed cells)
    3. Convert / Print as PDF selection A1 to "last cell with value 0"

    4. Save in same folder as excel document and use same file name for the pdf as the excel document but add current date to the file name as well. - OR: just any file name like "FM017_'current date'.pdf" (4. is optional - more important is step 1-3 at the moment)


    Who can solve this? Thanks heaps in advance already!
    Last edited by Jean-Felix; 07-10-2018 at 07:54 PM.

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

    Re: Set print area and save as pdf

    those list of cells almost form a pattern.... 22, 31,22,31,etc

    except when it hits these 3
    AK137
    AK157
    AK190

    sure its not meant to be AK159?
    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
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Set print area and save as pdf

    In the meantime you could try this.
    Add the remaining addresses first.
    Please Login or Register  to view this content.

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

    Re: Set print area and save as pdf

    awww....too slow again
    anyways since i made it ...heres what i came up with if the aforementioned pattern is true

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Set print area and save as pdf

    You have to change the old wbN line to this because you want the date in it and only one period before the extension.
    Please Login or Register  to view this content.
    @ humdingaling
    Doesn't hurt to have a choice, does it?

  6. #6
    Registered User
    Join Date
    02-07-2014
    Location
    Brisbane
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Set print area and save as pdf

    Super quick responses!!

    ups good eye, yes it should be AK159

    Tried both scripts but both of them create a pdf of the entire worksheet without stopping where I would want them.

    I'm using a simple IF function "=IF(A172=0,1,0)" and so on for the pattern.
    Last edited by Jean-Felix; 07-10-2018 at 09:52 PM.

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

    Re: Set print area and save as pdf

    hmmmm it works fine in my test file
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Set print area and save as pdf

    Same here. With and without the "If" formula

+ 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. Macro, to Set Print Area, Save as, Print
    By paul0872829332 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2015, 04:57 AM
  2. A way to save 'set print area' views?
    By Curious Dude in forum Excel General
    Replies: 3
    Last Post: 06-25-2015, 01:37 AM
  3. Save set print area as PDF
    By benjuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2015, 07:23 PM
  4. Save Print Area as PDF
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2013, 09:29 AM
  5. Mac office, print area save as PDF, name PDF by cell value
    By thequiff in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 10-25-2013, 01:41 PM
  6. Print area and save to pdf
    By saniamarco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 05:39 PM
  7. [SOLVED] How do I get excel 98 to save my set print area?
    By jlpdesign in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-18-2005, 10:06 AM

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