Excel 2003 macro printing

March 30, 2009 at 07:06:35
Specs: Windows XP

I'm using the macro below to print a selection of a sheet with the push of the button. Works like a charm. Push button, page prints. But I need the printer window to appear first so the user can select the printer needed.
How do i add this to the macro?

Sub MyPrint()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "J1:S67"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
End Sub

Thanks
Cat


See More: Excel 2003 macro printing

Report •


#1
March 30, 2009 at 08:41:23

Try this:

Sub MyPrint()
'Save ActivePrinter Name
  curPrinter = Application.ActivePrinter
'Let User Select Printer
  myPrinter = Application.Dialogs(xlDialogPrint).Show
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "J1:S67"
ActiveSheet.PageSetup.PrintArea = myPrtArea
'Print To Chosen Printer
  ActiveSheet.PrintOut ActivePrinter:=myPrinter
ActiveSheet.PageSetup.PrintArea = curPrtArea
'Reset Original Printer
  Application.ActivePrinter = curPrinter
End Sub


Report •
Related Solutions


Ask Question