Print dialog box using VBA in excel

  • Thread starter Thread starter steventu
  • Start date Start date
S

steventu

Hi Everyone,

I like to add a print button (that will select several worksheets and
print them) in my excel worksheet. I have recorded my action using the
macro recorder the problem is I can't select the printer everytime I
run the macro it print in the background without asking the user to
select the printer and uses the default printer.

Can anyone help?? I just want the user to be able to select the desired
printer every time before printing.

My current code:

Sub Print_All()

Sheets(Array("Sheet 1", "Sheet 2", "Sheet 3", "Sheet 5)).Select
'intentionally skip sheet 4

Sheets("Sheet 1").Activate
ActiveWindow.SelectedSheets.PrintOut Preview:=True
Sheets("Sheet 1").Select
End Sub

Thanks,

Steve
 
Hi Steventu,

See these statements:
Application.Dialogs(xlDialogPrint).Show
Application.Dialogs(xlDialogPrinterSetup).Show


HTH
 
Orlando Magalhães Filho,

I spent about a week searching on the web and looking through books for
it and no luck.

Thank you so much.

Steven Tu
 
Back
Top