Macro to print various pages

io1922

New Member
Joined
Jan 15, 2004
Messages
2
Good evening!

I have a wb that does its thing and then tells the user to print (for instance) page 1-6 and page 17. The first set of pages are always consecutive and the last page is always not consecutive with the first set of pages and is always a single page.

I have the page numbers calculated and stored in 3 cells:
Page 1 - always
Page x - last page in consecutive series
Page z - final "dangling" page

Can I get these 3 page numbers into a macro that will automatically print without user intervention?

All the pages are printed from the same worksheet, if that matters.

Thanks, and great board.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

SIXTH SENSE

Well-known Member
Joined
Oct 29, 2003
Messages
1,883
hi!
try this one.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> PrintingPagesx()
Frm = Range("A1").Value
ToEnd = Range("b1").Value
    ActiveWindow.SelectedSheets.PrintOut From:=Frm, To:=ToEnd, Copies:=1, Collate _
        :=<SPAN style="color:#00007F">True</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>

this prints the pages from specified page to specified end page. for one page print, frm and toend should be eqaul.
 

Forum statistics

Threads
1,186,159
Messages
5,956,258
Members
438,243
Latest member
FXA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top