Written by Allen Wyatt (last updated September 18, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Madhabi wants to print four copies of a worksheet, but have the value of cell A7 change for each copy. The four values are "Original," "Duplicate," "File," and "Driver." All other data being the same, Madhabi wonders how he can change the text of cell A7 while printing.
One possible approach is to create four different worksheets that contain essentially the same information. Worksheets 2 through 4 could all reference cells on worksheet 1, with the exception of cell A7 which could be set on each worksheet to a different value ("Original," "Duplicate," etc.).
A better approach, however, would be to create a quick macro that you could use for your printing. The macro could handle changing the value of cell A7 just before the worksheet is printed each time. Here's a simple example:
Sub PrintCopies() Dim i As Integer Dim VList As Variant VList = Array("Original", "Duplicate", "File", "Driver") For i = LBound(VList) To UBound(VList) Range("A7") = VList(i) ActiveSheet.PrintOut Next End Sub
The macro places the four values destined for cell A7 into an array. The macro then steps through each of the four array elements, putting the value into cell A7, and then printing the worksheet. Printing is done to whatever the default printer is on the system.
The macro could easily be assigned to a shortcut key or to the Quick Access Toolbar (as described in other ExcelTips) so that it you could print all four copies quickly.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9962) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Excel allows you to specify certain rows or columns that will be repeated on the pages of a printout. Here's how to set ...
Discover MoreIf a worksheet contains nothing but a bunch of values in column A, you may be loathe to print the worksheet and "waste" a ...
Discover MoreWould you like to have a worksheet automatically printed when a particular cell contains a specified value? You can ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-10-27 10:25:01
J. Woolley
@Andrew
Put the number of copies in cell A7, then run this:
Sub PrintCopies()
ActiveSheet.PrintOut Copies:=[A7]
End Sub
Also, see https://sites.google.com/view/MyExcelToolbox/
2021-10-26 13:32:56
Andrew
This is great! How would you go about printing out as many sheets as the number in a cell. Lets say the number in the cell was 3. The macro would then print out 3 copies of the sheet.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments