# Solved: Excel 2007 need to print odd/even pages



## dave.23 (Jan 8, 2005)

Hi can any one tell me how to print only odd or even pages in excel 2007.
I've seen people talk about macro's but i don't have a clue so a basic step by step would be much appreciated.

Thanks

Dave


----------



## etaf (Oct 2, 2003)

just an idea, when you go to print - you can usually select the pages to print (you have a choice of selection or pages on most printers ) - if you type in the pages section 1,3,5,7,9 etc for ODD and 2,4,6,8 etc for even - upto the maximum number of pages you have - it may save some time in macros etc 
It works for other documents - just never tried with excel, BUT if you set up the page in excel first dont see why not - Dont have Excel 2007 and I'm not near my 2003 version right now.
maybe worth a try


----------



## dave.23 (Jan 8, 2005)

I don't have the option to do that i can only input a range from say 1 to 49 but it print every page not just the odd ones see pic


----------



## hi-tech (Apr 23, 2010)

Follow this steps:

Open your document and click on the "View" Tab
Click on the "Macro" button in the right top corner.
In the Box that appears next type "Odd_Even_Print" as name and click "Create"; a Visual Basic editor page will open
Copy/Paste the rest of the script given below between "Sub Odd_Even_Print()" and "End Sub" ( don't need to save or anything just close it and save the excel file)
When you need to print repete steps 1 & 2 select the macro and click "Run"
In the box that appears next Type 1 for odd and 2 for even.


Sub Odd_Even_Print()
Dim Totalpages As Long
Dim StartPage As Long
Dim Page As Integer

StartPage = InputBox("Enter 1 for Odd, 2 for Even")

Totalpages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
For Page = StartPage To Totalpages Step 2
ActiveSheet.PrintOut from:=Page, To:=Page, _
Copies:=1, Collate:=True
Next
End Sub


----------



## dave.23 (Jan 8, 2005)

Cheers that's working great.
Is there any way i can change the printing order?
if i print the odd pages it prints 1,3,5ect but in order for me to print 2,4,6ect on the other side of the page i'll have to manually change the order of 1,3,5 when they come out of the printer, if you understand what i mean.


----------



## hi-tech (Apr 23, 2010)

That's being Greedy  

Add the following script after the earlier script.

You have to mention the last page number here, ie say you have 50 pages then, you'll have to type in 49 for odd and 50 for even.

Sub Odd_Even_Print_Reverse()
Dim StartPage As Long
Dim EndPage As Long
Dim Page As Integer


EndPage = InputBox("Enter the last page number")

StartPage = 1
For Page = EndPage To StartPage Step -2
ActiveSheet.PrintOut from:=Page, To:=Page, _
Copies:=1, Collate:=True
Next

End Sub


----------



## dave.23 (Jan 8, 2005)

You're the man thanks


----------

