+ Reply to Thread
Results 1 to 2 of 2

Print specified worksheets in workbook

  1. #1
    Forum Contributor
    Join Date
    04-04-2016
    Location
    dallas tx
    MS-Off Ver
    365 (15.0.5501.1000)
    Posts
    534

    Print specified worksheets in workbook

    I am currently using the following code to print a range of worksheets within my workbook. I was wondering however if I can add two printing stipulations to the code?
    Please Login or Register  to view this content.
    First, is it possible to add a line of code that will tell excel to print the sheets in color instead of black and white?

    and secondly I was wondering how to add a line of code that will restrict printing to only those sheets that have active data on them. In other words excel should look to a cell on each page and if that cell has data then the page should be printed. if that cell is empty then excel should not print that worksheet and should move the the next one.
    It would also be nice to be able to spectify a limit on the data to allow printing. if the percentage in the cell being looked at is 99% or lower then the page should be printed but if it is 100% or higher then the page should not print.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Print specified worksheets in workbook

    There are two settings to consider if you want to print in color.
    1. There is the Printer Driver color settings. Excel does not have much control for that setting. You have to go into your Windows Control Panel and change the printer driver settings.
    2. There is a setting within Excel that allows you to convert the printed sheet to a B&W document and then Print the sheet regardless if you have a color printer or not. So you can force a color printer to print in B&W by sending it only a B&W document. But you can't, from Excel, force a printer who's driver is set to print in B&W to print a color document. The B&W document setting in Excel is usually off by default. The code below makes sure that the Excel B&W setting is off just in case. But it won't guarantee that the Printer Driver is set to print in color. I don't know of a way to do that with code.


    The code also checks on each sheet before printing that cell A1 is not empty and it has a value <= 0.99

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 03-17-2018 at 02:02 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Use Excel Print Button to print all worksheets in workbook and then ungroup
    By Smudge72 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2016, 06:08 PM
  2. Replies: 0
    Last Post: 01-21-2013, 07:56 PM
  3. [SOLVED] Only Print specific worksheets in workbook
    By birchetts in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-12-2012, 05:39 AM
  4. Print specific worksheets in workbook
    By birchetts in forum Excel General
    Replies: 2
    Last Post: 03-30-2012, 03:25 AM
  5. Print worksheets Workbook
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-16-2012, 03:25 PM
  6. [SOLVED] Can I print a list of all of the worksheets within a workbook?
    By SRsonn in forum Excel General
    Replies: 1
    Last Post: 06-29-2005, 03:05 PM
  7. [SOLVED] How do I print only the hidden worksheets in a workbook?
    By Jking in forum Excel General
    Replies: 1
    Last Post: 03-09-2005, 07:06 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