I have the following code that I would like to make smaller perhaps by looping through. I tried doing a do while statement (cos < 6) but I couldn't figure out how to do the variable for the "cos_button_1.value". the "cos_button_"s are activeX option buttons.
I would greatly appreciate any assistance.
Dim cos As Integer
cos = 1
If cos_button_1.Value = True Then
Call foo(cos)
End If
cos = cos + 1
If cos_button_2.Value = True Then
Call foo(cos)
End If
cos = cos + 1
If cos_button_3.Value = True Then
Call foo(cos)
End If
cos = cos + 1
If cos_button_4.Value = True Then
Call foo(cos)
End If
cos = cos + 1
If cos_button_5.Value = True Then
Call foo(cos)
End If
Bookmarks