VBA Userform - Multi print options

MooseMoney

New Member
Joined
Jan 10, 2012
Messages
33
I need help with VBA code to print sheet ranges selected on a userform. The user
to choose which ranges to print - from a single range or any combination of ranges.
Most of the ranges to be printed in 1 x copy, a couple in 2 x copies, etc. ..... see
image below. The "Print" button is called "PrintButton1".

I do not have any code as I don't even know where to begin.
Your assistance will be highly appreciated!


ExcelVBAPrint.jpg


.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
In the Print commandbutton.
Code:
Private Sub CommandButton1_Click()
Dim CB As Control

    Application.ScreenUpdating = False

    For Each CB In Controls
        If TypeName(CB) = "CheckBox" Then
            Select Case True

            Case CheckBox1 'Name of your checkbox
                Sheet2.Range("B3:G32").PrintOut

            Case CheckBox2
                Sheet3.Range("F4:P30").PrintOut copies:=2

            'etc
            End Select
        End If
    Next
Unload Me
End Sub
 
Upvote 0

Forum statistics

Threads
1,206,946
Messages
6,075,790
Members
446,157
Latest member
mysteryg45

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