Option Boxes

Ste_Moore01

Active Member
Joined
Jul 13, 2005
Messages
467
Hi,

I'm trying to make a box like a with 2 options like a "Yes/No" box.

Is there a way of making a box like this but instead of having "Yes" and "No" can you replace these with different words?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Using the MsgBox function, you can have the following Buttons:

vbOKOnly 0 Display OK button only.
vbOKCancel 1 Display OK and Cancel buttons.
vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
vbYesNo 4 Display Yes and No buttons.
vbRetryCancel 5 Display Retry and Cancel buttons

Using a UserForm you can have whatever Buttons you want.
 
Upvote 0
How about option buttons. One way ....
Open the Forms toolbar and draw a "Group box" on the sheet.
Draw some Option Buttons inside the box. Only one of the option buttons inside the box can be "live".

If you hold down the Ctrl key and right-click on an Option Button (etc) you can change the properties (Format Control) as well as the text that shows.

To select more than one use Ctrl+Shift. You can then change the Cell Link property of the set to the same cell, which will indicate which one is selected.
 
Upvote 0
Do you mean a MsgBox? If so, what do you want on the buttons? Does that option exist when you look at the help for MsgBox?
 
Upvote 0
I would like a MsgBox to appear that says, "Is this an Electrical or Plumbing wholesaler?" and the options would be "Electrical Wholsaler" and "Plumbing Wholesaler".

I am able to make the MsgBox with the options that Andrew Poulsom stated but I was hoping to change them.
 
Upvote 0
The message box method does not allow many choices. I would handle something like this :-
Code:
Sub test()
    rsp = MsgBox("Is this an Electrical (or Plumbing) Wholesaler ?" & vbCr _
        & "'Yes' for Electrical" & vbCr _
        & "'No' for Plumbing", vbYesNoCancel)
    If rsp = vbYes Then
        ' "yes" code here
    ElseIf rsp = vbNo Then
        ' "no" code here
    Else
        Exit Sub
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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