lundi 16 février 2015

Script to Insert a Checkbox into every cell and assign it to that cell in Excel and returns true false in a specific selected cell

I would need additional help to this formula. Once I have entered this script in my excel worksheet the true false returns in the same cell (next) to the checkbox. How do I modify the script so that true false returns for one checkbox for example in cell (AI9) and for the following check boxes in "AI10, NEXT AI11 and so on.. 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





Aucun commentaire:

Enregistrer un commentaire