There must be a more elegant way
Posted by Slim on February 08, 2002 3:10 AM
I have created the following for part of a loan system project. The code works fine, but it looks horrible. Not being used to using the optionbuttons can anyone tell me a more elegant way similar to the select case that i use for comboboxes?
Private Sub CommandButton1_Click()
If OptionButton1.Value = True Then
Worksheets("juniorwheelchair").Select
Else
If OptionButton2.Value = True Then
Worksheets("smallwheelchair").Select
Else
If OptionButton3.Value = True Then
Worksheets("mediumwheelchair").Select
Else
If OptionButton4.Value = True Then
Worksheets("largewheelchair").Select
Else
If OptionButton5.Value = True Then
Worksheets("juniorcrutch").Select
Else
If OptionButton6.Value = True Then
Worksheets("adultcrutch").Select
Else
If OptionButton7.Value = True Then
Worksheets("juniorelbowcrutch").Select
Else
If OptionButton8.Value = True Then
Worksheets("adultelbowcrutch").Select
Else
If OptionButton9.Value = True Then
Worksheets("juniorneckcollar").Select
Else
If OptionButton10.Value = True Then
Worksheets("adultneckcollar").Select
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub