print only odd or even page

R

Romain

Is there a way to print only odd or even pages in Excel?
There is such a feature in the Print dialog box of MS
Word, but I don't see it in Excel. Any - simple - solution?

Thx,

Romain
 
R

Ron de Bruin

Hi Romain

You can use a macro to do it

Sub test()
Dim Totpage As Integer
Dim a As Integer
Totpage = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
For a = 2 To Totpage Step 2
ActiveSheet.PrintOut From:=a, To:=a, _
Copies:=1, Collate:=True
Next
End Sub

Change
For a = 2 To Totpage Step 2
to
For a = 1 To Totpage Step 2 for the other pages


Or this one from Gord Dibben with inputbox

Sub PrintDoubleSided()
Dim Totalpages As Long
Dim pg As Long
Dim oddoreven As Integer
On Error GoTo enditt
Totalpages = ExecuteExcel4Macro("Get.Document(50)")
oddoreven = InputBox("Enter 1 for Odd, 2 for Even")
For pg = oddoreven To Totalpages Step 2
ActiveWindow.SelectedSheets.PrintOut from:=pg, To:=pg
Next pg
enditt:
End Sub
 
Top