Code: Select all
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 blnSelected = True Then
ActiveWindow.SelectedSheets.Application.Dialogs(xlDialogPrint).Show
Unload Me
ActiveWorkbook.Protect PassWord:="", Structure:=True, Windows:=True
Else
MsgBox "No check boxes were selected"
End If
Application.ScreenUpdating = True