Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for i = 1 to 12
if Userform.Controls("OptionButton" & i).Value = True then b = i - 1 end if Next -- Regards, Tom Ogilvy " wrote in message ... Hi - I'm trying to clean up some code related to OptionButtons on a UserForm. Depending on what button someone selects, a variable that is used elsewhere in the code gets set. Here's my inefficient code: If UserForm.OptionButton1.Value = True Then b = 0 End If . . . and so on until If UserForm.OptionButton12.Value = True Then b = 11 End If I suspect there is some way to do this with Select Case, but I haven't been able to get it to work yet... Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How Do I Tab From An OptionButton To A TextBox | Excel Discussion (Misc queries) | |||
which optionbutton is on | Excel Programming | |||
OptionButton problem | Excel Programming | |||
optionbutton in userform | Excel Programming | |||
optionbutton in userform | Excel Programming |