create a button to print certain tabs in excel 2003

  • Thread starter Thread starter larry504
  • Start date Start date
L

larry504

I would like a way to search every tab in 1 workbook and the same cell on
each tab, than based an the value in the cell print the page or not
 
Something like this perhaps. I assumed the cell to check is A1, and to
print B1:G50 if A1>25. Post back if you need more. HTH Otto
Sub PrintIf()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
If .Range("A1") > 25 Then
.Range("B1:G50").PrintOut
End If
End With
Next ws
End Sub
 
Back
Top