Altering buttons on MsgBox

tbirdcarl

New Member
Joined
Jul 12, 2011
Messages
13
I have a message box and I what to know the amount of doors the cabinet has.

However, I don't know how to change the button options from yes and no
I would like the options to be "One" and "Two"



Code:
Door_message = MsgBox("how many doors does the cabinet have", vbYesNo)
        If Door_message = 6 Then
        'insert the single door to the cabinet
        ElseIf Door_message = 7 Then
        'insert the double door to cabinet
        End If
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You would need to create a userform that mimicks a vba msgBox.

Search Google - VBA Userforms for help on creating if your not familiar.
 
Upvote 0
Thanks for getting back to me so fast. I am going to mess around with the userform. I'll let you know how it goes.

Thanks again
 
Upvote 0
Ended up going with the userform
Perfect

I've only been doing VB excel coding for about 3 days now so the long code kinda freaked me out.
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

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