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

excel ²£¥Í¦h­Ó®Ö¨ú¤è¶ô.

¦^´_ 3# sworder12
2003ª©¥i¥Î
  1. Option Explicit
  2. Sub Ex()
  3.     Dim S As Integer, C As Variant
  4.     For Each C In ActiveSheet.OLEObjects
  5.         If C.Name Like "CheckBox*" Then
  6.             S = S + IIf(C.Object.Value, 1, 0)
  7.         End If
  8.     Next
  9.     MsgBox S
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# ML089

  1. Option Explicit
  2. Sub Ex()
  3.     Dim S As Integer, C As Variant
  4.     For Each C In ActiveSheet.OLEObjects   '±±¨î¤u¨ã½cªº±±¨î¶µ (MSForms.CheckBox)
  5.         If C.Name Like "CheckBox*" Then
  6.             S = S + IIf(C.Object.Value, 1, 0)
  7.         End If
  8.     Next
  9.     MsgBox S
  10.     S = 0
  11.     For Each C In ActiveSheet.CheckBoxes    'ªí³æªº±±¨î¶µ(®Ö¨ú¤è¶ô)
  12.             S = S + IIf(C.Value = 1, 1, 0)
  13.     Next
  14.     MsgBox S
  15. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# ML089
±±¨î¤u¨ã½cªº±±¨î¶µ,¥i¼gVBA

·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# ML089


·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 18# sworder12
³Ì«á¸õ¥X¤pµøµ¡Åã¥Ü¤@­Ó¡u 0 ¡v ½ÐªþÀɬݬÝ
¸Ñ¨M³y¦¨¨â­Ó®Ö¨ú¤è¶ô­«Å|.ªºµ{¦¡½X
  1. Option Explicit
  2. Sub Ex()
  3.     Dim C As Variant, B As Object, I As Integer, Rng(1 To 2) As Range
  4.     With ActiveSheet
  5.         Set Rng(1) = .Range("A:A").SpecialCells(2)  '³B¸Ì Aø󦳸ê®Æªº¤å¦rªº CheckBoxe
  6.         If .CheckBoxes.Count > 1 Then
  7.             For Each C In .CheckBoxes
  8.                 If Not Intersect(C.TopLeftCell.Offset(, -1), Rng(1).EntireColumn) Is Nothing Then
  9.                     If C.TopLeftCell.Offset(, -1) = "" Then
  10.                         C.TopLeftCell.Offset(, 1) = ""
  11.                         C.Delete
  12.                     Else
  13.                         C.Characters.Text = C.TopLeftCell.Offset(, -1)
  14.                         If Rng(2) Is Nothing Then
  15.                             Set Rng(2) = C.TopLeftCell.Offset(, -1)
  16.                         Else
  17.                             Set Rng(2) = Union(Rng(2), C.TopLeftCell.Offset(, -1)) '.Offset(, -1)
  18.                         End If
  19.                     End If
  20.                 End If
  21.             Next
  22.         End If
  23.         For Each C In Rng(1)        'Rng(2): CheckBoxe ªºTopLeftCellÀx¦s®æ
  24.             If Rng(2) Is Nothing Then
  25.                 Set B = .CheckBoxes.Add(C(1, 2).Left, C.Top, C.Width, C.Height)
  26.                 B.Characters.Text = C
  27.                 B.LinkedCell = C.Offset(, 2).Address
  28.             ElseIf Intersect(C, Rng(2)) Is Nothing Then
  29.                 Set B = .CheckBoxes.Add(C(1, 2).Left, C.Top, C.Width, C.Height)
  30.                 B.Characters.Text = C
  31.                 B.LinkedCell = C.Offset(, 2).Address
  32.             End If
  33.         Next
  34.     End With
  35. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD