View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Code to print most (not all) pages within active workbook

Try something like this

Sub test()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Name = "source data" Or sh.Name = "Sheet1" Then
' Do Nothing
Else
sh.PrintOut
End If
Next
Application.ScreenUpdating = True
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"AlanN" wrote in message ...
I have a project where the resultant page tabs are variable in number and the sheet names change everytime it's run.

Can someone suggest any code that will print all the pages in the active workbook except the pages called "Sheet1" and "source data"?

Thanks, Alan N