Printing Problems

ninjak

Board Regular
Joined
Mar 13, 2003
Messages
82
Is there a way to make a macro that i can choose what page to print ? on my sheet named compare i devided it up into 10 sheets but i cannot figure out how to make it print the page i want it too print say i wanted it too print page 5 and only 5 can somebody help me make something that will work please


Thanks AL
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
If you want them to print a single page, and they know what page number to print, try:

Sub macro()
Input1 = InputBox("Which page would you like to print?", "Print")
ActiveWindow.SelectedSheets.PrintOut From:=Input1, To:=Input1, Copies:=1, Collate _
:=True
End Sub
 
Upvote 0
Hi AL:

To print a specific page or a range of pages, you do not necessarily need a macro, you can do FILE|Print ... and then in the Print_range portion of the dialog box choose the option Page(s) and then key-in From and To page numbers.
 
Upvote 0
Something like:

Sub PrintPages()
Dim f, t As Integer

f = InputBox("Select start page 1 to 10", "Print From")
t = InputBox("Select end page " & f & " to 10", "Print To")

If MsgBox("Do you wish to print pages " & f & " to " & t, vbYesNo, "Confirm print") = vbYes Then
ThisWorkbook.PrintOut f, t
Else
End If

End Sub
 
Upvote 0
How can i make it always choose compare worksheet and then ask me what page ?


Thanks AL
 
Upvote 0
Press Alt-F11, which will bring up VBA.

From the insert menu, choose "module"

Copy and paste the detail in.

To use, press Alt-F8 and run the macro (or you can attach it to a button)
 
Upvote 0
alright i figure out how to add it is there a way to make it always choose compare sheet and when i print stuff now it shows little dotted lines how to i get those to go way after i print ?

Thanks AL
 
Upvote 0
Add the line:
Sheets("Compare").Select
before the input box.

Dotted lines sound like page breaks

If you have lines showing, you are either looking at it in page preview mode (click on view and choose normal to fix), or your options shown page breaks (tools, options, view tab - unchekc "page breaks")
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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