Code to print most (not all) pages within active workbook

A

AlanN

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
 
C

Cecilkumara Fernando

Alan,
try this

Sub Macro2()
Sheets(1).Activate
For i = 1 To Sheets.Count
Select Case Sheets(i).Name

Case Is = "Sheet1"

Case Is = "source data"

Case Else
Sheets(i).Activate
ActiveWindow.SelectedSheets.PrintPreview
End Select
Next i
End Sub

Cecil
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
 
Top