Search code examples
excelactivexform-control

How can I have couple of activeX (Radio Button) related to one cell?


can I have three "ActiveX"s (Radio Button) related to one cell with three different value

(exp.: "1" or "2" or "3") like a group option with three radio_buttons in form control?

Any idea is appreciated :)


Solution

  • Hope this is what you are looking for

    Insert 3 ActiveX Radio Buttons onto your sheet, make sure that you are in design mode, right click on one of the radio buttons, click on 'OptionButton Object' then 'Edit'.

    From there, paste the following code:

    Private Sub OptionButton1_Click()
    Range("A1").Value = 1
    End Sub
    
    Private Sub OptionButton2_Click()
    Range("A1").Value = 2
    End Sub
    
    Private Sub OptionButton3_Click()
    Range("A1").Value = 3
    End Sub