Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Fahimah Khan   on Dec 15 In MS Office Category.

  
Question Answered By: Madison Campbell   on Dec 15

Here is a macro  that I use. It captures the current default printer in a
variable, brings up a print  dialog to select a printer, prints the active
sheet and then sets the printer back to the default printer. To print a
specific selected  area on several sheets, you should set up a named range
for each selection, then you can select the named range and "print
selection".

Sub ChoosePrinter_Print()
'
vbPrinter = Application.ActivePrinter

MySettings = Application.Dialogs(xlDialogPrinterSetup).Show

''' InputBox to prompt for number of copies to be printed ...
Copy$ = Application.InputBox(Chr(10) & Chr(10) & Chr(10) & _
"Enter number of copis to print:", "Network Printing")

ActiveWindow.SelectedSheets.PrintOut copies:=Copy$

Application.ActivePrinter = vbPrinter
MsgBox "Default printer has been reset to:" & Chr(10) & Chr(10) & _
Application.ActivePrinter, vbInformation + vbOKOnly, "Network
Printing"
End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Macro to print Or get search suggestion and latest updates.


Tagged: