Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 o.Object Is MSForms.OptionButton Then ' do something with o.Object.GroupName and o.Object.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 -- Disregard, this is so I can find my post later. ***postedbyJay*** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, I found a solution, but I don't like it. I just used Linked Cells and
check the cells for the current value. It works, but feels like a workaround, not a genuine solution. Cheers, Jay -- Disregard, this is so I can find my post later. ***postedbyJay*** "Jay" wrote: 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 o.Object Is MSForms.OptionButton Then ' do something with o.Object.GroupName and o.Object.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 -- Disregard, this is so I can find my post later. ***postedbyJay*** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd use that inelegant loop.
Jay wrote: 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 o.Object Is MSForms.OptionButton Then ' do something with o.Object.GroupName and o.Object.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 -- Disregard, this is so I can find my post later. ***postedbyJay*** -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Retrieving Data: Speed of beating down rows vs retrieving from array? | Excel Programming | |||
for each optionbutton | Excel Programming | |||
optionbutton | Excel Programming | |||
optionbutton | Excel Programming | |||
OptionButton value | Excel Programming |