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

[µo°Ý] §PÂ_checkbox¬°true¤§«á±N¸ê®Æ¿ï¨ú

[µo°Ý] §PÂ_checkbox¬°true¤§«á±N¸ê®Æ¿ï¨ú

¤p§Ì¥Ø«e­n±Ncheckbox½T©w¬°true¤§¸ê®ÆÄæ¶i¦æ¿ï¨ú   ¨Ã©w¸q¬°¤@­Ó¦r¦ê ¥H«K¤§«á¶i¦æÀɮ׿é¥X¥Î

Function ¸ê®Æ¿é¥Xtest() '2013/08/12
    Dim CK As Object
    Dim HK As String
    For Each CK In ActiveSheet.OLEObjects
     If CK.Name Like "CheckBox*" & CK.Object.Value = True Then
   
²{¦b¥d¦bcheckbox¤£ª¾¹D¦p¦ó»P­n¿ï¨úªºÄæ¦ì°µ¤@­Ó³sµ²ªº°Ê§@

Àɮ׮榡¤j·§¦p¤U

»Ý­n±N³s¦Plistname³s¦Pitem¶i¦æ¿ï¨ú
               A                          B                     C
1         checkbox1    checkbox2    checkbox3

2         listname 1     listname 2    listname 3
3          item                 item                  item
4          item                 item                  item

¨D¦U¦ì«e½úÀ°¦£¸Ñµª~~~¡ã~

QQ ¸É¥R¤@¤U
¦]¤§«e·s¼Wcheckbox¤§µ{¦¡½X¦³ÂI°ÝÃD
checkbox¨Ã¤£·|¨Ì·Ó¸¹½X»¼¼W  ·|¦³¸õ¸¹°Ê§@@@

TOP

¦^´_ 2# rick4615
  1. Sub ¥[¤J()
  2. With ¤u§@ªí1
  3.   For i = 1 To 3
  4.   Set a = .Range("A1").Offset(, i)
  5.      With .OLEObjects.Add(ClassType:="Forms.CheckBox.1", Left:=.Cells(i, 1).Left, Top:=.Cells(i, 1).Top, Width:=100, Height:=20)
  6.      .LinkedCell = a.Address
  7.      .Object.Caption = i
  8.      End With
  9.   Next
  10. End With
  11. End Sub
  12. Sub §R°£()
  13. ActiveSheet.OLEObjects.Delete
  14. End Sub
  15. Sub ¸ê®Æ¿é¥X()
  16. With ¤u§@ªí1
  17. For i = 1 To .OLEObjects.Count
  18.    If .OLEObjects(i).Object.Value Then
  19.       Set a = Range(.OLEObjects(i).LinkedCell)
  20.       MsgBox a.Offset(1).Value & Chr(10) & a.Offset(2).Value & Chr(10) & a.Offset(3).Value
  21.     End If
  22. Next
  23. End With
  24. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# Hsieh

Hsieh«e½ú±z¦n ¤p§Ì¬Ý¤F±zªºµ{¦¡½X¤§«á¦³¨Ç¤£©ú¥Õ¡A¥i¯à»Ý­n±zÀ°¦£¸Ñµª¤@¤U¢I¢I

Sub §R°£()
ActiveSheet.OLEObjects.Delete               <= ³o¸Ì¬O­n§R°£¤°»òQQ? ¦pªG¦³¨ä¥Lªºoleobjects ·|¤£·|§R°£¨ì§Oªº©O?
End Sub

³Ì«á¤@¬q´N§¹¥þ¤£À´¤F@@

Sub ¸ê®Æ¿é¥X()
With ¤u§@ªí1
For i = 1 To .OLEObjects.Count
   If .OLEObjects(i).Object.Value Then
      Set a = Range(.OLEObjects(i).LinkedCell)
      MsgBox a.Offset(1).Value & Chr(10) & a.Offset(2).Value & Chr(10) & a.Offset(3).Value
    End If
Next
End With
End Sub

TOP

¦^´_ 4# rick4615
¤£¤F¸Ñ´N¦h¬ÝVBAªº»¡©ú
  1. Sub ¸ê®Æ¿é¥X()
  2. With ¤u§@ªí1
  3. For i = 1 To .OLEObjects.Count          'Count ÄÝ©Ê ¶Ç¦^¶°¦X¤¤ªºª«¥ó¼Æ¥Ø¡C
  4.    If .OLEObjects(i).Object.Value Then '  ¥¦ªºValue¬OTrue ±ø¥ó´N¦¨¥ß
  5.       Set a = Range(.OLEObjects(i).LinkedCell)
  6.       MsgBox a.Offset(1).Value & Chr(10) & a.Offset(2).Value & Chr(10) & a.Offset(3).Value
  7.     End If
  8. Next
  9. End With
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# rick4615
  1. Sub ¥[¤J()
  2. With ¤u§@ªí1
  3.   For i = 1 To 3 '¥[¤J3­ÓCheckBox
  4.   Set a = .Range("A1").Offset(, i)
  5.      With .OLEObjects.Add(ClassType:="Forms.CheckBox.1", Left:=.Cells(i, 1).Left, Top:=.Cells(i, 1).Top, Width:=100, Height:=20)
  6.      .LinkedCell = a.Address '«ü©w³sµ²Àx¦s®æ
  7.      .Object.Caption = i
  8.      End With
  9.   Next
  10. End With
  11. End Sub
  12. Sub §R°£()
  13. Dim Ob As OLEObject
  14. For Each Ob In ActiveSheet.OLEObjects
  15.    If Ob.progID = "Forms.CheckBox.1" Then Ob.Delete '¥u§R°£CheckBox
  16. Next
  17. End Sub
  18. Sub ¸ê®Æ¿é¥X()
  19. With ¤u§@ªí1
  20. For i = 1 To .OLEObjects.Count
  21. If .OLEObjects(i).progID = "Forms.CheckBox.1" Then
  22.    If .OLEObjects(i).Object.Value Then
  23.       Set a = Range(.OLEObjects(i).LinkedCell) '³Q¤Ä¿ï¦aªºCheckBox³sµ²Àx¦s®æ
  24.       MsgBox a.Offset(1).Value & Chr(10) & a.Offset(2).Value & Chr(10) & a.Offset(3).Value 'Åã¥Ü³Q¤Ä¿ïªº¶µ¥Ø
  25.     End If
  26. End If
  27. Next
  28. End With
  29. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# GBKEE


    ¦¬¨ì!  ¥u¬O±`±`¤À¶}§ÚÁÙ¯à¤j·§¸³ ¦X¦b¤@°_´N¤£ª¾¹D«ç¸Ñ¤F

TOP

¦^´_ 6# Hsieh

½Ð°Ý«e½ú ¦p¦ó­nÅý¥L¦Û°Ê¼W¥[offset¶µ¥Ø©O??
¦]¬°¸ê®Æ¤ñ¼Æ¥i¯à¬O·|Åܰʪº ¦pªG¼g³o¼Ë¬O¤£¬O·|µLªk±o¨ì©Ò¦³¸ê®Æ©O@@?

TOP

¦^´_ 8# rick4615
  1. Sub ¸ê®Æ¿é¥X()
  2. With ¤u§@ªí1
  3. For i = 1 To .OLEObjects.Count
  4. If .OLEObjects(i).progID = "Forms.CheckBox.1" Then
  5.    If .OLEObjects(i).Object.Value Then
  6.       Set a = .Range(.OLEObjects(i).LinkedCell) '³Q¤Ä¿ï¦aªºCheckBox³sµ²Àx¦s®æ
  7.       MsgBox Join(Application.Transpose(.Range(a.Offset(1), a.End(xlDown))), Chr(10)) 'Åã¥Ü³Q¤Ä¿ïªº¶µ¥Ø
  8.    End If
  9. End If
  10. Next
  11. End With
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 9# Hsieh


   §Ú¸ÕµÛ¥Î«e½úªº¤èªk§ï§Úªºµ{¦¡½X  ¤£¹L¤@ª½¦æ¤£³q
¥i¥H³Â·ÐÀ°§Ú¬Ý¬Ý°ÝÃD¥X¦b­þ¶Ü@@?
³o¬O·s¼Wªº³¡¤À
For i = 0 To ListCount - 1
      Set a = Range("A3").Offset(, i)
        OLEObjects.Add(ClassType:="Forms.CheckBox.1", _
        DisplayAsIcon:=False, Link:=False, Left:=0 + 93.5 * i, Top:=126, Width:=90, Height:=22.5) _
        .Object.Caption = listname(i) _
        .LinkedCell = a.Address
     Next i
   
¥L·|¤@ª½¥X²{  " ¤£¥¿½Tªº©w¦ì¶µ(qualifier) "

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD