A
Aaron
Check boxes to select what combination of sheets is printed.
I am getting an End without Next Error. Help!
Private Sub PrintSelected_Click()
Application.Dialogs(xlDialogPrint).Show
If CheckBox1 = True Then
Sheets("ClientData").PrintOut
If CheckBox2 = True Then
Sheets("W1").PrintOut
If CheckBox3 = True Then
Sheets("Fee").PrintOut
If CheckBox4 = True Then
Sheets("Data").PrintOut
If CheckBox5 = True Then
Sheets("B1").PrintOut
If CheckBox6 = True Then
Sheets("B2").PrintOut
If CheckBox7 = True Then
Sheets("B3").PrintOut
If CheckBox8 = True Then
Sheets("B4").PrintOut
If CheckBox9 = True Then
Sheets("B5").PrintOut
If CheckBox10 = True Then
Sheets("B6").PrintOut
If CheckBox11 = True Then
Sheets("B7").PrintOut
If CheckBox12 = True Then
Sheets("B8").PrintOut
If CheckBox13 = True Then
Sheets("B9").PrintOut
If CheckBox14 = True Then
Sheets("B10").PrintOut
If CheckBox15 = True Then
Sheets("B11").PrintOut
If CheckBox16 = True Then
Sheets("B12").PrintOut
If CheckBox17 = True Then
Sheets("B13").PrintOut
If CheckBox18 = True Then
Sheets("B14").PrintOut
If CheckBox19 = True Then
Sheets("B15").PrintOut
If CheckBox20 = True Then
Sheets("Combined").PrintOut
If CheckBox21 = True Then
Sheets("Summary").PrintOut
If CheckBox22 = True Then
Sheets("Results").PrintOut
If CheckBox23 = True Then
Sheets("Bar").PrintOut
If CheckBox24 = True Then
Sheets("Pie").PrintOut
If CheckBox25 = True Then
Sheets("Cash").PrintOut
If CheckBox26 = True Then
Sheets("NPV").PrintOut
If CheckBox27 = True Then
Sheets("EX I").PrintOut
If CheckBox30 = True Then
Sheets("Summary").PrintOut
If CheckBox28 = True Then
Sheets("Results").PrintOut
Sheets("bar").PrintOut
Sheets("pie").PrintOut
Sheets("Cash").PrintOut
Sheets("NPV").PrintOut
Sheets("Ex I").PrintOut
If CheckBox29 = True Then
Sheets("Summary").PrintOut
Sheets("ClientData").PrintOut
Sheets("W1").PrintOut
Sheets("Fee").PrintOut
Sheets("Data").PrintOut
'xlSheetVisible = -1
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
If sh.Visible = -1 Then
If sh.Range("B71").Value <> "" Then
sh.PrintOut
If CheckBox31 = True Then
Sheets("Summary").PrintOut
Sheets("ClientData").PrintOut
Sheets("W1").PrintOut
Sheets("Fee").PrintOut
Sheets("Data").PrintOut
'xlSheetVisible = -1
Dim she As Worksheet
For Each she In ThisWorkbook.Worksheets
If she.Visible = -1 Then
If she.Range("B71").Value <> "" Then
she.PrintOut
Sheets("Results").PrintOut
Sheets("bar").PrintOut
Sheets("pie").PrintOut
Sheets("Cash").PrintOut
Sheets("NPV").PrintOut
Sheets("Ex I").PrintOut
End If
End If
End Sub
I am getting an End without Next Error. Help!
Private Sub PrintSelected_Click()
Application.Dialogs(xlDialogPrint).Show
If CheckBox1 = True Then
Sheets("ClientData").PrintOut
If CheckBox2 = True Then
Sheets("W1").PrintOut
If CheckBox3 = True Then
Sheets("Fee").PrintOut
If CheckBox4 = True Then
Sheets("Data").PrintOut
If CheckBox5 = True Then
Sheets("B1").PrintOut
If CheckBox6 = True Then
Sheets("B2").PrintOut
If CheckBox7 = True Then
Sheets("B3").PrintOut
If CheckBox8 = True Then
Sheets("B4").PrintOut
If CheckBox9 = True Then
Sheets("B5").PrintOut
If CheckBox10 = True Then
Sheets("B6").PrintOut
If CheckBox11 = True Then
Sheets("B7").PrintOut
If CheckBox12 = True Then
Sheets("B8").PrintOut
If CheckBox13 = True Then
Sheets("B9").PrintOut
If CheckBox14 = True Then
Sheets("B10").PrintOut
If CheckBox15 = True Then
Sheets("B11").PrintOut
If CheckBox16 = True Then
Sheets("B12").PrintOut
If CheckBox17 = True Then
Sheets("B13").PrintOut
If CheckBox18 = True Then
Sheets("B14").PrintOut
If CheckBox19 = True Then
Sheets("B15").PrintOut
If CheckBox20 = True Then
Sheets("Combined").PrintOut
If CheckBox21 = True Then
Sheets("Summary").PrintOut
If CheckBox22 = True Then
Sheets("Results").PrintOut
If CheckBox23 = True Then
Sheets("Bar").PrintOut
If CheckBox24 = True Then
Sheets("Pie").PrintOut
If CheckBox25 = True Then
Sheets("Cash").PrintOut
If CheckBox26 = True Then
Sheets("NPV").PrintOut
If CheckBox27 = True Then
Sheets("EX I").PrintOut
If CheckBox30 = True Then
Sheets("Summary").PrintOut
If CheckBox28 = True Then
Sheets("Results").PrintOut
Sheets("bar").PrintOut
Sheets("pie").PrintOut
Sheets("Cash").PrintOut
Sheets("NPV").PrintOut
Sheets("Ex I").PrintOut
If CheckBox29 = True Then
Sheets("Summary").PrintOut
Sheets("ClientData").PrintOut
Sheets("W1").PrintOut
Sheets("Fee").PrintOut
Sheets("Data").PrintOut
'xlSheetVisible = -1
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
If sh.Visible = -1 Then
If sh.Range("B71").Value <> "" Then
sh.PrintOut
If CheckBox31 = True Then
Sheets("Summary").PrintOut
Sheets("ClientData").PrintOut
Sheets("W1").PrintOut
Sheets("Fee").PrintOut
Sheets("Data").PrintOut
'xlSheetVisible = -1
Dim she As Worksheet
For Each she In ThisWorkbook.Worksheets
If she.Visible = -1 Then
If she.Range("B71").Value <> "" Then
she.PrintOut
Sheets("Results").PrintOut
Sheets("bar").PrintOut
Sheets("pie").PrintOut
Sheets("Cash").PrintOut
Sheets("NPV").PrintOut
Sheets("Ex I").PrintOut
End If
End If
End Sub