ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦³ÃöOptionButton°j°é°ÝÃD

¦³ÃöOptionButton°j°é°ÝÃD

¥H¤U¬O§Ú¤u§@ªí(1)ªºµ{¦¡½X¡A½Ð°ÝOptionButton & i_Click¥i¥H¼g¦¨°j°é¶Ü?
ÁÙ¬O»¡¨C·s¼W¤@µ§¿ï¶µ«ö¶sªº¸ê®Æ¡A´N±o·s¼W¤@¦¸µ{§Ç?
(¦pªG¦³1000µ§¸ê®Æ¡A´N­nSub 1000¦¸?)
Private Sub OptionButton1_Click()
If OptionButton1 = True Then Cells(1, 2).value = Cells(4, 2)
End Sub
Private Sub OptionButton2_Click()
If OptionButton2 = True Then Cells(1, 2).value = Cells(5, 2)
End Sub
Private Sub OptionButton3_Click()
If OptionButton3 = True Then Cells(1, 2).value = Cells(6, 2)
End Sub
Private Sub OptionButton4_Click()
If OptionButton4 = True Then Cells(1, 2).value = Cells(7, 2)
End Sub
Private Sub OptionButton5_Click()
If OptionButton5 = True Then Cells(1, 2).value = Cells(8, 2)
End Sub

­Y¤£¥ÎOptionButton_Click¨Æ¥ó§ï¥Î¤@­Ó¹Lµ{°õ¦æ­Ë¥i¥H«Ø¥ß­Ó°j°é¤@¤@§PÂ_¡C
­n¥ÎOptionButton_Click¨Æ¥ó°õ¦æªº¸Ü¡A±o¥Î¨ìª«¥óÃþ§O¼Ò²Õ¡C

TOP

½Ð°Ýª©¥D­n¦p¦ó«Ø¥ß°j°é©O?
´¿¸Õ¹L¥Î°}¦C¨Ó²¤Æµ{¦¡½X¡Aµ²ªG¶V¼g¶V½ÆÂøªº·Pı¡C
(§Ú¬Oexcel ªì¾ÇªÌ)

TOP

Sub yy()
    Dim o As OLEObject, c%
    For Each o In Me.OLEObjects
        If o.Name Like "OptionButton" & "*" Then
            If o.Object.Value = True Then
                c = Replace(o.Name, "OptionButton", "")
                Cells(1, 2).Value = Cells(c, 2): Exit For
            End If
        End If
    Next
End Sub
³o¼Ë´N¬O°j°é¡A¦ý§A¥²¶·°õ¦æ³o­Óµ{¦¡¦Ó¤£¬OÂIÀ»OptionButton«á¦Û°Ê°õ¦æ¡I

TOP

¥»©«³Ì«á¥Ñ solely ©ó 2010-8-17 20:24 ½s¿è

«D±`·PÁª©¥DªºÀ°¦£XD
(§Ú²×©ó¤£¥ÎSub¤@¤d¦¸¤F)

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD