Add "Print" button to my msg box

nirvehex

Well-known Member
Joined
Jul 27, 2011
Messages
503
Office Version
  1. 365
Platform
  1. Windows
Hi I have a code:


Code:
Sub ScopeofWorkInstructions()


Dim response As VbMsgBoxResult
Dim ws As Worksheet


response = MsgBox("                                             SCOPE OF WORK INSTRUCTIONS:" _
& vbNewLine & " " _
& vbNewLine & "1. Please fill out as much information as possible." _
& vbNewLine & " " _
& vbNewLine & "2. Use the Notes column for additional information discussed." _
& vbNewLine & " " _
& vbNewLine & "3. Download the Client's Logo and insert it as a picture sized to fit within the logo box." _
& vbNewLine & " " _
& vbNewLine & "4. Please return to the Navigation and check the completion box when finished." _
, vbOKCancel)
If response = vbCancel Then Exit Sub


Set ws = Worksheets("Scope of Work")
ws.Activate


End Sub

Can I add a print button which will print what's in the msgbox?


Thank you!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You can't print directly from a msgbox. You either need to write the message to somewhere on your worksheet or use a userform with a text box containing the message and print it from there.
 
Upvote 0
Oh come on..haha, I can't double dip with some help from the VBA forum? I do enjoy and appreciate both forums thoroughly. Joe, thank you for the response. I kind of figured that, but wasn't sure. Also, in my defense I did post that one to VBA before I saw you're response.
 
Upvote 0
So question for both of you. More of an opinion/design question.

Say you had a macro. Once run, it first pops up a msgbox with instructions on what the macro is going to do, and what input it needs from the user. You can press OK to proceed or Cancel to exit the msgbox. I want the user to be able to print these instructions for reference. What would be best way to go about allowing the user to print what's in the msgbox?

I was thinking, maybe have this text pre-written elsewhere and create like was said, a "Userform" instead of a msgbox so I can add a print button to the userform which opens up the same thing as Control+P would do on a windows OS.

Any other ideas? Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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