J
Jay
Hello all,
I'm trying to get the values of an option button, but I'm not having any
luck. I'm hoping someone with more experience can help me out. I have very
little experience with the controls and they've stumped me.
I'm trying to retrieve the values from 10 different groups of radio (option)
buttons. I've used the control toolbox controls, not form controls.
I've set the GroupName of the 10 different groups. They are fairly simple.
Reason01...Reason10.
I'm now trying to determine the value of each group. This is being done
from a public module, not the private module of the sheet. So I can't just
use OptionButton1.Value = ? (I tried that too).
I can loop through each OLEObject like so:
Dim o As OLEObject
For Each o In wrk.OLEObjects
If TypeOf bject Is MSForms.OptionButton Then
' do something with bject.GroupName and bject.Value
End If
Next o
But is there some way to specify the GroupName and get the selected radio
value of that group? Looping through doesn't seem very elegant, and I feel I
might be missing something obvious.
Any thought are appreciated.
Thanks,
Jay
I'm trying to get the values of an option button, but I'm not having any
luck. I'm hoping someone with more experience can help me out. I have very
little experience with the controls and they've stumped me.
I'm trying to retrieve the values from 10 different groups of radio (option)
buttons. I've used the control toolbox controls, not form controls.
I've set the GroupName of the 10 different groups. They are fairly simple.
Reason01...Reason10.
I'm now trying to determine the value of each group. This is being done
from a public module, not the private module of the sheet. So I can't just
use OptionButton1.Value = ? (I tried that too).
I can loop through each OLEObject like so:
Dim o As OLEObject
For Each o In wrk.OLEObjects
If TypeOf bject Is MSForms.OptionButton Then
' do something with bject.GroupName and bject.Value
End If
Next o
But is there some way to specify the GroupName and get the selected radio
value of that group? Looping through doesn't seem very elegant, and I feel I
might be missing something obvious.
Any thought are appreciated.
Thanks,
Jay