I have a spreadsheet that is continuously being updated to track visitations to patients. I have 2 columns that I've used the below VBA code to enter multiple checkboxes into which are assigned to the cell into which they are located. However, I would like to add something that makes the value of the checkboxes either Yes or No when I click on them. There are over 600 of these in the spreadsheet, so I need something that will cover all of them at once instead of having to change each one separately. I would post a pic of the spreadsheet, but I can't yet since I'm a new user and don't have reputation points. Can anyone help?
Sub AddCheckBoxes()
Dim cb As CheckBox
Dim myRange As Range, cel As Range
Dim wks As Worksheet
Set wks = Sheets("Sheet1")
Set myRange = wks.Range("K2:K300, L2:L300")
For Each cel In myRange
Set cb = wks.CheckBoxes.Add(cel.Left, cel.Top, 30, 6)
With cb
.Caption = ""
.LinkedCell = cel.Address
End With
Next
End Sub
End Sub
Aucun commentaire:
Enregistrer un commentaire