- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 18# sworder12
³Ì«á¸õ¥X¤pµøµ¡Åã¥Ü¤@Ó¡u 0 ¡v ½ÐªþÀɬݬÝ
¸Ñ¨M³y¦¨¨âÓ®Ö¨ú¤è¶ô«Å|.ªºµ{¦¡½X- Option Explicit
- Sub Ex()
- Dim C As Variant, B As Object, I As Integer, Rng(1 To 2) As Range
- With ActiveSheet
- Set Rng(1) = .Range("A:A").SpecialCells(2) '³B¸Ì Aø󦳸ê®Æªº¤å¦rªº CheckBoxe
- If .CheckBoxes.Count > 1 Then
- For Each C In .CheckBoxes
- If Not Intersect(C.TopLeftCell.Offset(, -1), Rng(1).EntireColumn) Is Nothing Then
- If C.TopLeftCell.Offset(, -1) = "" Then
- C.TopLeftCell.Offset(, 1) = ""
- C.Delete
- Else
- C.Characters.Text = C.TopLeftCell.Offset(, -1)
- If Rng(2) Is Nothing Then
- Set Rng(2) = C.TopLeftCell.Offset(, -1)
- Else
- Set Rng(2) = Union(Rng(2), C.TopLeftCell.Offset(, -1)) '.Offset(, -1)
- End If
- End If
- End If
- Next
- End If
- For Each C In Rng(1) 'Rng(2): CheckBoxe ªºTopLeftCellÀx¦s®æ
- If Rng(2) Is Nothing Then
- Set B = .CheckBoxes.Add(C(1, 2).Left, C.Top, C.Width, C.Height)
- B.Characters.Text = C
- B.LinkedCell = C.Offset(, 2).Address
- ElseIf Intersect(C, Rng(2)) Is Nothing Then
- Set B = .CheckBoxes.Add(C(1, 2).Left, C.Top, C.Width, C.Height)
- B.Characters.Text = C
- B.LinkedCell = C.Offset(, 2).Address
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|