LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default End without Next Error

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 03:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"