Try something like the following:
Dim curVis As Long
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
Select Case sh.Name
Case "Data1", "Data2", "Data3"
' ignore these sheets
Case Else
curVis = .Visible
.Visible = xlSheetVisible
.PrintOut
.Visible = curVis
End Select
End With
Next sh
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Ant" wrote in message
...
Thanks Tom. What would need adding if I actually had three
(maybe more)
sheets I wanted excluded, say 'Data1', 'Data2', Data3'.
"Tom Ogilvy" wrote:
'Dave Peterson
Dim curVis As Long
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
if lcase(sh.name) < "data" then
curVis = .Visible
.Visible = xlSheetVisible
.PrintOut
.Visible = curVis
end if
End With
Next sh
End Sub
--
Regards,
Tom Ogilvy
"Ant" wrote:
I saw this handy code on Ron Debruin's page which prints all
hidden and
unhidden pages.
'Dave Peterson
Dim curVis As Long
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
curVis = .Visible
.Visible = xlSheetVisible
.PrintOut
.Visible = curVis
End With
Next sh
End Sub
Is it possible to incoporate some additional code which
excludes some
sheets. Basically I have a report and I want to print all
the pages (some
hidden) except the large data dump sheet. Lets say the sheet
is called 'Data'.
Is this possible?