May 5th, 2009, 02:36 AM
determine which option (radio) button is active
Here is a function I made up (with tips from Hannesthegreat and Wof)..might come in handy....
'Determines & returns which option button in an array is presently active
'Returns -1 when none are active (such as at initialization)
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
Last edited by WizBang; May 7th, 2009 at 08:58 AM.
Reason: Added [code] tags
May 5th, 2009, 03:13 AM
Re: determine which option (radio) button is active
None of us EVER post code without using CODE TAGS!!!
That didn't really help anyone, so who will search for it? Add it to your other post instead
' Please learn how to use them, or don't post any more code.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!