prevent print

  • Thread starter Thread starter joemeshuggah
  • Start date Start date
J

joemeshuggah

i am using the following piece of code to prevent the printing of a few
specified tabs in a workbook, however, it does not appear to be working
correctly. where am i going wrong? using excel 2003

For Each Sheet In ThisWorkbook
If Sheet.Name <> "TestData" And Sheet.Name <> "ResultDetail" And
Sheet.Name <> "ControlDetail" Then
Sheet.PrintOut
End If
Next
 
Hi,

Try it this way

Dim WS As Worksheet
S = "ResultDetail,ControlDetail,ResultDetail"
V = Split(S, ",")
For Each WS In ThisWorkbook.Worksheets
If IsError(Application.Match(CStr(WS.name), V, 0)) Then
WS.PrintOut
End If
Next

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
Back
Top