Create Print button that print another sheet

Unexpc

Active Member
Joined
Nov 12, 2020
Messages
496
Office Version
  1. 2019
Platform
  1. Windows
Hi guys
how to create a vba button for print preview or quick print from another sheet?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Or better say Does any code that print from another sheet? That use by button or run a macro or print preview or quick print in quick access toolbar or anything...
 
Upvote 0
Like this
i want select quick print in top of the app in ribbon window that quick print from another sheet...
how can i do this?
 

Attachments

  • Screenshot 2020-12-02 174006.jpg
    Screenshot 2020-12-02 174006.jpg
    104.6 KB · Views: 38
Upvote 0
And anotherthing, can set default printer for this?
I have code for compile with subject post...
Code:
Private Sub Workbook_Open()
    Dim DefaultPrinter As String
    Dim Tempraryprinter As String

    Tempraryprinter = "Microsoft Print to PDF" '

   Application.ActivePrinter = Tempraryprinter & " on Ne01:"
    

End Sub
 
Upvote 0
Try Using This. Shows the all Printer names and you can select:

VBA Code:
Application.Dialogs(xlDialogPrinterSetup).Show
 
Upvote 0
Also Check this method:
Go Settings -> Devices -> Printers & Scanners, scroll down and un-check "Let Windows manage my default printer".
Then Use this code:
VBA Code:
CreateObject("WScript.Network").SetDefaultPrinter "Microsoft Print to PDF"
 
Upvote 0
Also Check this method:
Go Settings -> Devices -> Printers & Scanners, scroll down and un-check "Let Windows manage my default printer".
Then Use this code:
VBA Code:
CreateObject("WScript.Network").SetDefaultPrinter "Microsoft Print to PDF"
i just set a default printer for excel app,for example a code use in private sub before print
 
Upvote 0
Then again use this line at the last of your code at set back printer name to your previous default printer.
 
Upvote 0
i don't know this is right?
VBA Code:
Private Sub Workbook_Open()
CreateObject("WScript.Network").SetDefaultPrinter "Microsoft Print to PDF"
End Sub
 
Upvote 0
Then again use this line at the last of your code at set back printer name to your previous default printer.
How about this do you know?
 

Attachments

  • Screenshot 2020-12-02 174006.jpg
    Screenshot 2020-12-02 174006.jpg
    104.6 KB · Views: 18
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

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