Saving all worksheets to seperate PDF files but excluding specific worksheets

  • [xpost][/xpost]…files-vba-coding.1195462/

    Hi all,

    I am a bit new to VBA coding but have managed to create a macro that lets me save multiple worksheets to separate pdf's.
    But, I don't want to include two specific sheets, for ex, sheet TEMPLATE and SOURCE DATA how can I exclude these two and print the rest?

    This is my code:

    I would be very grateful for any assistance

    My best regards from a cold Sweden,

  • The closest I can get is with this IF not statment, Now I can exclude the Source data sheet but still not the Template sheet,

  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post

    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.

    How to use code tags

    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


  • Try this

  • Hi Roy,

    Thank you very much, now it works!

    Went through the Forum Rules too fast ( as usually ;)

    Will take a closer look and make sure to wrap in Code Tags next time :)

    Again, Thank you!

    Best regards

    VBA Padawan

  • Also, read all the Rules, specifically Cross Posting.

    Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the URL from the address bar in your browser) to the cross-post. We are here to help so help us help you!

    Read this to understand why we ask you to do this

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!