BatchPrinting

lighting77

New Member
Joined
Apr 19, 2012
Messages
10
Office Version
  1. 365
Platform
  1. Windows
I have a excel form with a drop down menu containing product codes that populates other cells within the form when each unique product code is selected. I like to print all forms, each form having its unique product code and it’s relevant populated cells.
How can I print all of these at ones without selecting each product code and than hitting print. Could anyone help, please. Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
A macro could iterate over all the drop down menu's items.

When you say "excel form", do you really mean
A) a VBA Userform or
B) rather an Excel worksheet
?
 
Upvote 0
Right-click on the Dropdown element and in the context menu select Format control (or whatever it is called in your language). In the second box of the dialog's last tab (Control) you can determine a cell which will be linked to the the current selection in the dropbox. If the first element of the dropbox is selected, the cell will show 1, if the 2nd element is selected, the cell shows 2 and so on.
The link is bidrectional: if you enter 1 into the cell, the dropbox will show the first entry, if you enter 2 into the cell, ....

So a macro can enter 1, 2, 3, ... into the cell, the dropdown element shows the 1st, 2nd, 3rd, ... entry and (as if the user had changed the dropdown element) the other cells are populated accordingly.
Add a print command (PrintOut) to the macro and done.

A working example is here. This is the code included:
VBA Code:
Option Explicit

Sub print_all()
    Dim dd As DropDown
    Dim i As Integer
    
    With ActiveSheet
        Set dd = .DropDowns(1)
        For i = 1 To .Range(dd.ListFillRange).Cells.Count
            .Range(dd.LinkedCell).Value = i
            
            .PrintOut
        Next
    End With
End Sub
 

Attachments

  • Screenshot.png
    Screenshot.png
    26.5 KB · Views: 6
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top