+ Reply to Thread
Results 1 to 6 of 6

Macro to print all worksheets to pdf apart from the first one

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Macro to print all worksheets to pdf apart from the first one

    Hi, I would like to create a macro that prints all worksheets to a pdf file but I don't want the first sheet to be included.

    I would just hardcode in the sheets but I won't know how many there will be so I want to start at sheet 2 and put the rest of the sheets into a single pdf file.

    I have the following code which hard codes the sheets but would really appreciate some advice as to how I can modify it to do exactly what I want.

    HTML Code: 
    Thanks very much in advance

    :-)
    :-)

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Macro to print all worksheets to pdf apart from the first one

    Turn on the macro recorder.
    Select the first sheet you want to print
    Hold down shift and select the last sheet (assuming contiguous range)
    Print the sheets
    Turn off the macro recorder
    Look at the code - this should help you help yourself.

    If you learn to use the recorder, you will have a process to help you learn so much more than if someone provides an answer to your question.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to print all worksheets to pdf apart from the first one

    That's still going to show hard-coded sheet names, MC.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro to print all worksheets to pdf apart from the first one

    It works perfectly! Thank you so much, I am having a very stressful weekend trying to get something to work that I have promised to a director!!!! You have helped me out in a very big way. Thanks for your time :-)

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro to print all worksheets to pdf apart from the first one

    @ RebeccaEllis

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

  6. #6
    Registered User
    Join Date
    05-22-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro to print all worksheets to pdf apart from the first one

    Of course, sorry I forgot!

+ 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