Print only if Cell is non-blank

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting an "out-of-range" error on this code:

Private Sub PrintButton1_Click()

If IsEmpty(Worksheets("Sheet1").Range("A8").Value) Then
Worksheets("Sheet1").PrintOut Copies:=1
End If

End Sub

I have a command button set up such that when clicked, the code should check
a certain cell on each sheet of a workbook and print the sheets that have
some value in that cell. Any ideas??
 
subscript out of range for the following code would be an indication the
sheet is not named exactly "Sheet1". There may be a space somewhere in the
name as an example.
 
Back
Top