View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark Dullingham Mark Dullingham is offline
external usenet poster
 
Posts: 92
Default Userforms checkboxes and printing

I've sorted it out. If anyone is interested or can suggest a better way, the
code I used is

Private Sub CommandButton1_Click()
If CheckBox1 = True Then
Worksheets("WK 1").PrintOut Copies:=1, Collate:=True
End If
If CheckBox2 = True Then
Worksheets("WK 2").PrintOut Copies:=1, Collate:=True
End If
If CheckBox3 = True Then
Worksheets("WK 3").PrintOut Copies:=1, Collate:=True
End If
If CheckBox4 = True Then
Worksheets("WK 4").PrintOut Copies:=1, Collate:=True
End If
If CheckBox5 = True Then
Worksheets("WK 5").PrintOut Copies:=1, Collate:=True
End If
If CheckBox6 = True Then
Worksheets("EX's").PrintOut Copies:=1, Collate:=True
End If
If CheckBox7 = True Then
Worksheets("MR").PrintOut Copies:=1, Collate:=True
End If
If CheckBox8 = True Then
Worksheets("OT").PrintOut Copies:=1, Collate:=True
End If
End Sub

This works but it does send idividual jobs to the printer. I would prefer it
to be one job, so if any one has any ideas!!!

"Mark Dullingham" wrote:

I have a workbook with a main page and on the page I ahve 7 command buttons
to print specific pages abd 1 command buuton to print all 7 pages.

What I would like to do is contol the printing from a userform.

I have designed a form with 7 checkboxes, a command button to close the form
and a print command button.

What I don't know how to do is get the print button to print the pages
selected by the 7 checkboxes.

Could anyone help with this please.

Thanks in advance for any responses.