Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VBA code for Option Button choices on Userform  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

RedBorg

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 8
    VBA code for Option Button choices on Userform
    « on: April 13, 2016, 01:19:21 AM »
    Hi, I'm still struggling with this code I'm trying to get right. I need to replace the ComboBox in the code below with option buttons instead. I have 7 option buttons I'd rather use then the ComboBox on my userform. Once the user selects one of the 7 choices from the option buttons, that choice name or I'm guessing OptionButton(?).Value would be placed in the code below instead of ComboxBox1.Value.  And if possible, can the Userform reset after it closes? if so, How?
    Thanks for all your help

    Code: [Select]
    Private Sub CommandButton1_Click()

      Selection.Offset(, 1).Resize(1, 3).Value2 = _
        Array(ComboBox1.Value, TextBox1.Value, TextBox2.Value)
     
      Unload Me
     
    End Sub