Macro to show and stop at the File:Print view

KFE916

New Member
Joined
Sep 23, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi,
I feel like this should be easy, but after googling like crazy I'm not finding the correct solution. I would like to have a simple macro that will take the user to the traditional print preview for the current worksheet so they can review, make changes to the page setup if needed, and then click the print on their own. The worksheet will have a different name every time as this will be a template they copy. And they will be printer to different printers often. I've found the macro that takes the user to a modified print preview, but it's not the one we want because we want them to be able to verify or choose the option to print selected area. Or can that be built into the macro with it still going to and stopping at print preview?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi KFE916,

Welcome to MrExcel!!

The following macro has two options for you to try (I have put their source link next to each command):

VBA Code:
Option Explicit
Sub MyPrintPreview()

    Application.Dialogs(xlDialogPrint).Show 'https://excelribbon.tips.net/T010321_Displaying_the_Print_Dialog_Box_in_a_Macro.html
    Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint") 'https://stackoverflow.com/questions/35835084/how-to-show-print-dialog-box-and-print-preview-on-same-screen

End Sub

Regards,

Robert
 
Upvote 0
Solution
Hi KFE916,

Welcome to MrExcel!!

The following macro has two options for you to try (I have put their source link next to each command):

VBA Code:
Option Explicit
Sub MyPrintPreview()

    Application.Dialogs(xlDialogPrint).Show 'https://excelribbon.tips.net/T010321_Displaying_the_Print_Dialog_Box_in_a_Macro.html
    Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint") 'https://stackoverflow.com/questions/35835084/how-to-show-print-dialog-box-and-print-preview-on-same-screen

End Sub

Regards,

Robert
That second one worked perfectly! Thank you Robert for making one of our users extremely happy to have this exact option.
 
Upvote 0
That second one worked perfectly! Thank you Robert for making one of our users extremely happy to have this exact option.

Thanks for letting us know and you're welcome (y)
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

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