我需要这个公式的额外帮助。在我的excel工作表中输入此脚本后,真正的false将返回到复选框的同一单元格(下一个)。如何修改脚本,以便为一个复选框返回true false,例如在单元格(AI9)和" AI10,NEXT AI11等中的以下复选框。
Sub AddCheckBoxes()
Dim cb As CheckBox
Dim myRange As Range, cel As Range
Dim wks As Worksheet
Set wks = Sheets("mySheet") 'adjust sheet to your needs
Set myRange = wks.Range("A1:A10") ' adjust range to your needs
For Each cel In myRange
Set cb = wks.CheckBoxes.Add(cel.Left, cel.Top, 30, 6) 'you can adjust left, top, height, width to your needs
With cb
.Caption = ""
.LinkedCell = cel.Address
End With
Next
End Sub
答案 0 :(得分:0)
.LinkedCell = wks.Cells(cel.Row,"AI").Address()