Here is a function I made up (with tips from Hannesthegreat and Wof)..might come in handy....
Code:'Determines & returns which option button in an array is presently active 'Returns -1 when none are active (such as at initialization) 'example: text3.text=str(WhichOptionActive(optRadioButtonBank1)) ' Public Function WhichOptActive(CtrlArr As Variant) As Integer Dim Cntrl As Control WhichOptActive = -1 'default, if none active For Each Cntrl In CtrlArr If Cntrl.Value = True Then 'look for active option button WhichOptActive = Cntrl.Index Exit Function 'if found, get out now End If Next Cntrl End Function


Reply With Quote
If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Bookmarks