Hi there! I've created a userform with 26 option buttons, half of which are "yes" buttons and the other half "no". Of the "no" buttons, some run the following sub (below is a general sub; in reality, there are 10 subs, each with the corresponding numbers in place of # and @):

Private Sub OptionButton#_Click()

    'Shows the corresponding textbox if "no" is selected
    If OptionButton#.Value Then
        [email protected] = True
    End If

End Sub
Where # is the option button's index (4, 6, 8, 10, 14, 16, 20, 22, 24, or 26) and @ is the corresponding textbox's index (2, 3, 9, 10, 17, 16, 23, 24, 30, or 31). The idea is, when you select one of these "no" option buttons, the corresponding textbox is displayed. (Conversely, when "yes" is selected, the textbox is hidden.)

Currently, I have one sub for each option button. I want to make a class that will replace the 10 userform subs that are currently being used. I've played around with classes, but I'm having trouble telling the function in the class which textbox the option button affects (for example, OptionButton4 affects TextBox2). I was able to follow this example quite easily:

http://www.thelandbeyondspreadsheets...el-vba/#showme

...but I don't know how the include the textbox in what I want to do.

Any help is much appreciated!