+ Reply to Thread
Results 1 to 9 of 9

How do you create a macro to print out all worksheets except for two specific worksheets

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2012
    Posts
    6

    Question How do you create a macro to print out all worksheets except for two specific worksheets

    I am trying to create a macro that will print out all worksheets except for two worksheets I do not want printed out. The worksheets already have defined printing areas so I do not need to set which cell range to print.

    I am looking for help with the code to print all sheets except for ABC and DEF worksheets.

    Thank you

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    G'day and welcome,

    I've used this method on one of my workbook. Method supplied by Ron de Bruin. Information is found on This page and scroll down to the title Print every Worksheet with a value In cell A1.

    Please Login or Register  to view this content.
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  3. #3
    Registered User
    Join Date
    04-20-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2012
    Posts
    6

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Not sure I am following you. I want to be able to exclude certain worksheets within the file. Where is the area I can exclude the specific worksheets. For example, where can I place the names of the worksheets I do not want printed?

  4. #4
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Find a same cell in each spreadsheet that empty on the spreadsheet you like to print, place the text 'Printme' (without quotes) in that cell.

    Then change this line in the vba

    If Sh.Visible = xlSheetVisible And Sh.Range("A1").Value <>
    "Printme" Then

    Then run the macro.

    Note: I'm still a vba novice

  5. #5
    Registered User
    Join Date
    04-20-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2012
    Posts
    6

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Isn't there a way I can have excel exclude certain prenamed worksheets I have that I do not want printed and then print everything else?

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

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Can you change the attached to your wishes?
    If not, just ask.

  7. #7
    Registered User
    Join Date
    04-20-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2012
    Posts
    6

    Question Re: How do you create a macro to print out all worksheets except for two specific workshee

    This still seems too complicated. Is there a way I can do this in one button. I only want the macro to print out all worksheets except for three sheets called "ABC", "DEF", and "XYZ". What would be great is a macro that prints out all of the worksheets that are not any of the three. Is this possible?

  8. #8
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Okay I've got a workbook working but to the opposite what I've stated above.

    The workbook I have working is at work so I can't review on what I've done properly too it work.

    See the attachment for details. bbl need to do a shop run.
    Attached Files Attached Files

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

    Re: How do you create a macro to print out all worksheets except for two specific workshee

    Like this you mean?

    Please Login or Register  to view this content.
    Or have a read about Select Case

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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