User Defined Caption On Dialogue Box

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hello All,
I wanna know if it's possible to asign a caption to my message box other than the yes and no or the ok and cancel stuffs. If this is possible then somebody show me how to do it.

Thanks
Kelly

Code:
Sub PrintMaster()
    Dim answer As Long
            answer = MsgBox("Are you sure about this?", _
                    vbYesNo + vbDefaultButton2 + vbQuestion, _
                        "Print MasterSheet?")
                            If answer = vbYes Then
                                With Sheet1
                        .PrintOut
                    End With
                Else
            Exit Sub
        End If
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Kelly

Doesn't your message box already have a caption - 'Print MasterSheet?'?
 
Upvote 0
@Norie, I am referring to the buttons. Sorry for not making it clear before.

Can I change the captions on the Yes button to something else?

Thanks
 
Upvote 0
Kelly

Sorry but that's not possible with a standard message box.
 
Upvote 0
Okay thanks. But can there be anything else apart from the standard?
 
Upvote 0

Forum statistics

Threads
1,225,523
Messages
6,185,467
Members
453,296
Latest member
zashue22

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