sarasotavince
New Member
- Joined
- May 14, 2011
- Messages
- 24
Hello one and all:
I have multiple optionbutton groupings on the same userform. I am using the group name in the properties box (set1, set2, set3, etc) so that only one choice can be made from each group. I can write code to get the first group to operate but I cannot figure out how to use the group name to control the code for each additional grouping (set1, set2, set2, etc). Can someone help me modify this code to reflect only a specific group (say, set1) and I can repeat the process with each group. Much thanks.
For i = 1 To 12 'THIS IS THE FIRST SET OF OPTIONBUTTONS
If Me.Controls("OptionButton" & i).Value = True Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
MsgBox "Found it" 'OR WRITE THE CAPTION VALUE TO SOME SHEET
Exit For<o></o>
End If<o></o>
Next i
I figure there has to be a way to use the group name to control the code. I will end up having 6 or 7 groups and each selection from within each group upon exit will do something different. (I can handle this part).
One last thing. I do not want to use frames. And wouldn't the code be basically the same using a frame name instead of a group name? The reason I ask is because I might want to use a frame for this very same problem on another project.
Thanks so much.
I have multiple optionbutton groupings on the same userform. I am using the group name in the properties box (set1, set2, set3, etc) so that only one choice can be made from each group. I can write code to get the first group to operate but I cannot figure out how to use the group name to control the code for each additional grouping (set1, set2, set2, etc). Can someone help me modify this code to reflect only a specific group (say, set1) and I can repeat the process with each group. Much thanks.
For i = 1 To 12 'THIS IS THE FIRST SET OF OPTIONBUTTONS
If Me.Controls("OptionButton" & i).Value = True Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
MsgBox "Found it" 'OR WRITE THE CAPTION VALUE TO SOME SHEET
Exit For<o></o>
End If<o></o>
Next i
I figure there has to be a way to use the group name to control the code. I will end up having 6 or 7 groups and each selection from within each group upon exit will do something different. (I can handle this part).
One last thing. I do not want to use frames. And wouldn't the code be basically the same using a frame name instead of a group name? The reason I ask is because I might want to use a frame for this very same problem on another project.
Thanks so much.