Run-time error '1004': while trying to p_rint

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
831
Office Version
  1. 365
Platform
  1. Windows
I have created a user form were I select certain checkboxes for the sheets I want to print and then run the code below to print.

If possible could someone take a look and see what I need to correct to fix this problem? Thanks for the help as always
Here is the code I have
Code:
Private Sub CommandButton1_Click()
If Me.CheckBox1 = True Then
    ThisWorkbook.Sheets("SHT#1").PrintOut Copies = 1
End If


If Me.CheckBox2 = True Then
    ThisWorkbook.Sheets("SHT#2").PrintOut Copies = 1
End If


If Me.CheckBox3 = True Then
    ThisWorkbook.Sheets("SHT#3").PrintOut Copies = 1
End If


If Me.CheckBox4 = True Then
    ThisWorkbook.Sheets("SHT#4").PrintOut Copies = 1
End If


If Me.CheckBox5 = True Then
    ThisWorkbook.Sheets("SHT#5").PrintOut Copies = 1
End If


If Me.CheckBox6 = True Then
    ThisWorkbook.Sheets("SHT#6").PrintOut Copies = 1
End If


If Me.CheckBox7 = True Then
    ThisWorkbook.Sheets("SHT#7").PrintOut Copies = 1
End If


If Me.CheckBox8 = True Then
    ThisWorkbook.Sheets("SHT#8").PrintOut Copies = 1
End If


If Me.CheckBox9 = True Then
    ThisWorkbook.Sheets("SHT#9").PrintOut Copies = 1
End If


If Me.CheckBox10 = True Then
    ThisWorkbook.Sheets("SHT#10").PrintOut Copies = 1
End If


If Me.CheckBox11 = True Then
    ThisWorkbook.Sheets("SHT#11").PrintOut Copies = 1
End If


If Me.CheckBox12 = True Then
    ThisWorkbook.Sheets("SHT#12").PrintOut Copies = 1
End If


If Me.CheckBox13 = True Then
    ThisWorkbook.Sheets("SHT#13").PrintOut Copies = 1
End If


If Me.CheckBox14 = True Then
    ThisWorkbook.Sheets("SHT#14").PrintOut Copies = 1
End If


If Me.CheckBox15 = True Then
    ThisWorkbook.Sheets("SHT#15").PrintOut Copies = 1
End If


If Me.CheckBox16 = True Then
    ThisWorkbook.Sheets("SHT#16").PrintOut Copies = 1
End If


If Me.CheckBox17 = True Then
    ThisWorkbook.Sheets("SHT#17").PrintOut Copies = 1
End If


If Me.CheckBox18 = True Then
    ThisWorkbook.Sheets("SHT#18").PrintOut Copies = 1
End If


If Me.CheckBox19 = True Then
    ThisWorkbook.Sheets("SHT#19").PrintOut Copies = 1
End If


If Me.CheckBox20 = True Then
    ThisWorkbook.Sheets("SHT#20").PrintOut Copies = 1
End If


If Me.CheckBox21 = True Then
    ThisWorkbook.Sheets("SHT#21").PrintOut Copies = 1
End If


If Me.CheckBox22 = True Then
    ThisWorkbook.Sheets("SHT#22").PrintOut Copies = 1
End If


If Me.CheckBox23 = True Then
    ThisWorkbook.Sheets("SHT#23").PrintOut Copies = 1
End If


If Me.CheckBox24 = True Then
    ThisWorkbook.Sheets("SHT#24").PrintOut Copies = 1
End If


If Me.CheckBox25 = True Then
    ThisWorkbook.Sheets("SHT#25").PrintOut Copies = 1
End If


If Me.CheckBox26 = True Then
    ThisWorkbook.Sheets("SHT#26").PrintOut Copies = 1
End If


End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You're missing the : from after Copies
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top