Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Specifying Print Quantity in a Cell.

Specifying Print Quantity in a Cell

Written by Allen Wyatt (last updated October 12, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

Tom is trying to create some macro code that will control the quantity of copies to print, based on the value entered in a cell. He has created an input form for his shipping personnel to use that prints package content labels. He would like to be able to have them enter into cell B11 the number of labels that need to be printed, and then have that number printed.

This is relatively easy to do, depending on what you want to have printed. If you want to print just the contents of the active worksheet, then you can use code similar to the following:

iNumCopies = Range("B11").Value
If iNumCopies < 1 Then iNumCopies = 1
ActiveSheet.PrintOut Copies:=iNumCopies

If you don't want to print the entire worksheet, then you need to modify the PrintOut statement just a bit. For instance, the following example presumes that the "label" to be printed in in the range A1:A5:

Set MyRange = Range("A1:A5")
iNumCopies = Range("B11").Value
If iNumCopies < 1 Then iNumCopies = 1
MyRange.PrintOut Copies:=iNumCopies

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9487) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Specifying Print Quantity in a Cell.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Indirect References to a DSUM Parameter

Indirect references can be very helpful in formulas, but getting your head around how they work can sometimes be ...

Discover More

Accurately Setting Tabs Using the Ruler

If you try to set tabs by clicking on the Ruler, you may not be able to set them exactly where you want. This is normally ...

Discover More

Changing Pronoun Gender

Sometimes it is necessary to change the gender of various pronouns used in a document. If you have a stock document that ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Printing Individual Worksheets for Vendors

If you use a worksheet to track data for multiple vendors, you may wonder if there is a way to print individual ...

Discover More

Printing Just the Visible Data

In a large worksheet, you may want to display and print just a portion of the available data. Displaying the desired ...

Discover More

Printing in Black and White and Color

Excel can print your worksheets in either black and white or color. If you want to print everything in black and white ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

2022-09-01 16:41:15

Joseph

Specifying Print Quantity in a Cell, is helpful but i want to know how to print a picture from this quantity??


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.