print macro

alanoreilly

Board Regular
Joined
Dec 4, 2003
Messages
56
as a part of a print macro I want to let users decide which sheets to print using a form...

on pressing a button I want a form to pop up with check boxes (for example) beside each sheet name....the macro then prints tehw selected sheets........is this possible???

Thanks,
Alan
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Add the checkboxes to the form and add a command button with this code;

Code:
Private Sub CommandButton1_Click()
If UserForm1.CheckBox1 = True Then Sheets("Sheet1").PrintOut
If UserForm1.CheckBox2 = True Then Sheets("Sheet2").PrintOut
If UserForm1.CheckBox3 = True Then Sheets("Sheet3").PrintOut
'sets checkboxes back to false (unticked)
UserForm1.CheckBox1 = False
UserForm1.CheckBox2 = False
UserForm1.CheckBox3 = False
UserForm1.Hide
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,174
Messages
6,053,908
Members
444,694
Latest member
JacquiDaly

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