VBA warning to print 1 page

excellence

Board Regular
Joined
Oct 5, 2005
Messages
155
Office Version
  1. 365
Platform
  1. MacOS
I have a 2 page spreadsheet that I would like to warn me, prior to printing to print 1 page as I need to take the printed page and flip it to print page 2

I tried the vba below, but I can't get past the warning to print page 1 as the message keeps coming back.
Perhaps there is a different way but wonder how to edit this to answer no and proceed to the print dialog box so I can choose which page to print, not both.

My guess is to have the cancel=true modified to take me to the print dialog box?

Many thanks

VBA Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Result = MsgBox("PRINT 1 PAGE  ANSWER >>> NO", vbYesNo)
    If Result = vbNo Then
        Cancel = True
    End If
End Sub
 
since my last post I have done, I believe what the guide says, but can't get it to run automatically when I choose PRINT.
I can run the macro macro>run but it doesn't automatically run.
I have created a new module and pasted your vba into it.

Guess I am still missing something :confused:
Will continue to see what I am missing
Thanks
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I guess you better wait for someone else. After 20 posts, you still refuse to tell us step by step what you want to achieve.

Good Luck
 
Upvote 0
Want to be reminded to select one page when printing if I print. May want to print preview the spreadsheet and not print it when I see the preview, but was reminded about just printing one page if I decide to print.

Is this the Print Preview you are refering to?

print.png
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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