For i = 0 To 29
  If optionbutton(0).value = True Then
  ...
  End If
Next

解决方案 »

  1.   

    用for循环的方法可以的,不过我愿意用一个flag变量来判断。
      

  2.   

    flag=true
    For i = 0 To 29
       flag=flag*optionbutton(i).value 
    Next 
      

  3.   

    快速找到选中的OptionButton 
    OptionButton控件经常是作为控件数组存在的,要快速找到其中的哪一个被选中,可以使用下面的代码: 
    '假设控件数组包含3个OptionButton控件 
    intSelected = Option(0).Value * 0 - Option(1).Value * 1 - Option(2).Value * 2 
    '注意,因为第一个操作数总是0,所以上述代码可以精简如下: 
    intSelected = -Option(1).Value - Option(2).Value * 2 
      

  4.   

    flag=true
    For i = 0 To 29
      flag=flag*optionbutton(i).value 
    Next 
      

  5.   

    Dim i As Integer
    Dim OptionSelected As Integer
    For i = 1 To Option1.Count - 1
        OptionSelected = OptionSelected - Option1.Item(i).Value * i
        If OptionSelected > 0 Then  
           Exit For
        End if
    Next i
    MsgBox OptionSelected 
      

  6.   

    我有更好的办法!
    思路是写位(Bite)
    就象汇编里的FLAGS一样。