At the present moment I use this approach to print selected sheets using checkboxes and then set my default printer to PDF Creator.
Code: Select all
Private Sub CommandButton2_Click()
Dim blnSelected As Boolean
ActiveWorkbook.Protect Password:="", Structure:=False, Windows:=False
Application.ScreenUpdating = False
If CheckBox1.Value And Sheets("Cover Page").Visible = xlSheetVisible Then
Sheets("Cover Page").Select Replace:=True
blnSelected = True
End If
If CheckBox2.Value And Sheets("Client Information").Visible = xlSheetVisible Then
Sheets("Client Information").Select Replace:=False
blnSelected = True
End If
If CheckBox3.Value And Sheets("Utilities").Visible = xlSheetVisible Then
Sheets("Utilities").Select Replace:=False
blnSelected = True
End If
If CheckBox4.Value And Sheets("Grounds").Visible = xlSheetVisible Then
Sheets("Grounds").Select Replace:=False
blnSelected = True
End If
If blnSelected = True Then
ActiveWindow.SelectedSheets.PrintOut
Unload Me
Unload UserForm4
Worksheets("Cover Page").Select
ActiveSheet.Range("D7").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True, _
Password:="", UserInterfaceOnly:=True
ActiveWorkbook.Protect Password:="", Structure:=True, Windows:=True
Else
MsgBox "No check boxes were selected"
End If
Application.ScreenUpdating = True
End Sub