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?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi Mark,

On your print button, call another form asking your questions with 2 buttons on it, button one is the cancel button;
Code:
Unload Me
Button 2 has the print macro behind it.

HTH
Colin
 
Upvote 0
Are you referring to the default excel print button, or will you be talking about a print button on your worksheet that will do these custom checks?

If you're talking about a button on your worksheet, you can use a message box or a user form.

The message box gives a cleaner yes/no question, but arranging the display of data you want to check in a message box will be difficult to arrange.

Alternatively, you could use a user form that would give you some more control on how you'd like the data to be presented for the user to proofread before they commit to the print.
 
Upvote 0
I added a print command to the sheet, but want a pop up box to appear with an ok and cancel button option in it. Th pop up should populate with cell info of my choice.
 
Upvote 0
This is my printer code. Not sure what to add to call up a user form

Dim x As Integer
x = Range("V9").Value
Range("V6").Select
Selection.ClearContents
Range("V8:V14").Select
Selection.ClearContents
Range("X8:X12").Select
Selection.ClearContents
Range("Z8:Z12").Select
Selection.ClearContents
Range("X13:AA13").Select
Selection.ClearContents
Range("X14").Select
Selection.ClearContents
Range("Z14").Select
Selection.ClearContents
Range("V15").Select
Selection.ClearContents
Range("X18").Select
Selection.ClearContents
Range("W19:X24").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=9
Range("W28:X29").Select
Selection.ClearContents
Range("W30").Select
Selection.ClearContents
Range("W31").Select
Selection.ClearContents
Range("X32").Select
Selection.ClearContents
Range("W33:W35").Select
Selection.ClearContents
Range("W36:X49").Select
Selection.ClearContents
Range("W50").Select
Selection.ClearContents
Range("W51:X55").Select
Selection.ClearContents
Range("W56:X56").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=18
Range("V62:V67").Select
Selection.ClearContents
Range("Y62:Z67").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-51
Range("V6").Select
Selection.ClearContents
x = x + 1
Range("V9").Value = x
Range("V9").Select
Range("V6").Select
Selection.ClearContents
End Sub
 
Upvote 0
Right, but it depends on how much data you want the user to check. If it's only a few things, a message box will work fine. But if it's a whole ton of stuff, the userform may be better as you can more easily organize the display.

Here's some message box code that I use to give the user a choice.

Code:
Sub PrintTMBLT()
'
' PrintAll Macro
'
      Dim Response As Integer
      ' Displays a message box with the yes and no options.
      Response = MsgBox(prompt:="This will print the Metrics & MetricStack sheets to your default printer." & vbCrLf & vbCrLf & "Do you want to continue?", Buttons:=vbOKCancel)
      ' If statement to check if the yes button was selected.
      If Response = vbOK Then
         '------Code start--------------
             Sheets(Array("Metrics", "MetricStack")).Select
             Sheets("Metrics").Activate
 
             ActiveWindow.SelectedSheets.PrintOut
 
             Sheets("Selection").Select
             Sheets("Metrics").Select
        '------Code stop---------------
      Else
         ' The no button was selected.
      End If
   End Sub
 
Last edited:
Upvote 0
It would be like 5 items, a name and certain other info. Basically asking the transcriber before printing the info, if this is the correct employee info. So it will just have a few items in the box.
 
Upvote 0
I just want the info show as info only and not directly editable in the pop up box. Reason being, if the employee inf is wrong, then the whole input would be incorrect and so the whole sheet would need to be redone.
 
Upvote 0
Mark;

Try this code on your 'Print' button' (Remove your print code)
Code:
Private Sub PrintButton()
UserForm1.Show
End Sub

Create a userform (UserForm1) and add 2 buttons to it;
Code:
Private Sub CommandButton1_Click()
Unload Me
End Sub
and
Code:
Private Sub CommandButton2_Click()
'Your print macro here
End Sub
CommandButton2 is where you will put your print macro;
Add a 'Label' to your userform and change its caption to whatever you want to ask (Is this data correct?,... Have you filled out your name ..blah...blah etc...)
if you want to show the contents of a cell then add another label (Delete its caption property, so it's blank) and use this code;
Code:
Private Sub UserForm_Initialize()
Label2.Caption = Sheets("Sheet1").Range("A1").Value
End Sub

Adjust ranges to suit,

HTH
Colin
 
Upvote 0
So in your example, my cells would be say A1,D1,C1,D1,

Basically,

Name
SSN
YEAR
Phone#
This type of info would populate the pop up box once my print command button is pressed.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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