I'm trying to print 16 pages from one worksheet, double-sided.
For example I have a 30 page worksheet. I want to print only the odd pages up to pg 15, and then I want to print only the even pages up to page 16. My printer doesn't do two-sided printing, so I need to do it in Excel 2007.
The most useful thing I found while googling was this macro:
but it only prints all the even or all the odd pages. I would like to be able to specify a range of odd pages and a range of even pages to print, or even specify exactly what pages I'd like to print like I can in Acrobat Reader or Word 2007.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
I notice that that macro has "from:=Page, To:=Page, _". would I be able to edit this macro to do what I want? If so, would I then need to re-edit the macro for every different sized worksheet?
Or is there another macro that will put up a dialog box - the same way the above does - that will allow me to specifically print pages 1, 3, 5, 7, etc., or odd pages 1-15?
Thank you!
P.S. I did find a workaround whereby I print to PDF first, then print out the pages from there, but it'd be nice to not need to.
Last edited by Earmite; 01-06-2012 at 05:42 PM.
Try
Sub PrintPGs() Dim BegP As Integer, EndP As Integer, Pages As Integer BegP = InputBox("Starting", "Print") EndP = InputBox("Ending", "Print") For Pages = BegP To EndP Step 2 ActiveSheet.PrintOut from:=Pages, To:=Pages, _ Copies:=1, Collate:=True Next Pages End Sub
To thank someone who has helped you, click on the star icon below their name.
I hate reading
Portfolio
I need a job.I am young and incompetent
Thanks JieJenn! That worked perfectly!
If I understand the macro correctly, I specify the range, and the macro starts at the start page, and just prints every-other page until the specified end page? That's very clever!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks