Pop up on pressing print button

MarkDShark

Board Regular
Joined
Jun 10, 2008
Messages
228
Is there a way to create a pop up box once a print command button is pressed? Once the print button is pressed, a popup would appear asking if certain information on the sheet is correct (information from certain cells i select for it to pick up), with an ok and cancel button, and once the ok is pressed, the printing would continue or "cancel" to correct the info. Is this possible?
 
This bit of code takes the data from Sheet1 A1:D1 and places it on the userform (popup)

Code:
Private Sub UserForm_Initialize()
Label2.Caption = Sheets("Sheet1").Range("A1").Value
Label3.Caption = Sheets("Sheet1").Range("B1").Value
Label4.Caption = Sheets("Sheet1").Range("C1").Value
Label5.Caption = Sheets("Sheet1").Range("D1").Value
End Sub


HTH
Colin
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
The label doesn't have to reference a cell, you can also use it as its name sugests, a 'label' to type a comment in, 'Is the below correct?' then use the other labels to show the data entered.
 
Upvote 0
I got it to work, but the popup doesn't close once i've verfied the information as correct and allowed the printing. I named the 2 buttons yes and no, upon selecting as, the doc should print and the pop up should close, well it prints but the box remains open. Is there another piece of code that needs to be part of the print code? Code i'm using,

Private Sub CommandButton1_Click()
Sheets(2).PrintOut
End Sub

Thats the code for my "Yes" button. Once selected, it will print the sheet. It needs to close after Yes is selected.
 
Upvote 0

Forum statistics

Threads
1,225,151
Messages
6,183,197
Members
453,151
Latest member
Lizamaison

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