MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Macro to print

  Asked By: Fahimah    Date: Dec 15    Category: MS Office    Views: 771

I would like to create a macro that allow to choose 1 of the two
printers that I have and then print the selected area in the sheets
following some order (for example sheet 1 - page 1&2; sheet 2 - page 3;
sheet 1- page 4, ...)

Can someone help me ?



2 Answers Found

Answer #1    Answered By: Minnie Romero     Answered On: Dec 15

Have you tried using the macro  recorder to record the steps? That is
usually my first step. Then I start manipulating the resulting to code
to add refinement.

Hopefully this will help  you get started and then we can better assist
you in refining the end results.

Answer #2    Answered By: Madison Campbell     Answered 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

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
End Sub

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