
Originally Posted by
Leith Ross
When you need exclusive selection, one out of many, the control of choice is a Radio Button.
Holy words.

Originally Posted by
Leith Ross
unless you just want to know how it is done.
And it gets done in this way:
Sub Add_Checkboxes()
Dim c As Excel.CheckBox
Dim rngChkBoxes As Range
Dim Rng As Range
'Delete all preexisting checkboxes
For Each c In Worksheets(1).CheckBoxes
c.Delete
Next
'Generate the checkboxes in a predefined range
Set rngChkBoxes = Range("I5, J5, I7, J7, I9, J9, I18, J18")
For Each Rng In rngChkBoxes
Set c = Worksheets(1).CheckBoxes.Add(Left:=Rng.Left, Top:=Rng.Top, Width:=Rng.Width, Height:=Rng.Height)
With c
.Caption = ""
.Name = "chk_" & IIf(Rng.Column = 9, "Yes", "No") & "_" & Rng.Row
.OnAction = "IsChecked"
End With
Next Rng
End Sub
Private Sub IsChecked()
Dim c As Excel.CheckBox
Dim varName As Variant
With ActiveSheet
Set c = .CheckBoxes(Application.Caller)
varName = Split(c.Name, "_")
If varName(1) = "Yes" Then
ActiveSheet.CheckBoxes("chk_No_" & varName(2)).Value = -4146
Else
ActiveSheet.CheckBoxes("chk_Yes_" & varName(2)).Value = -4146
End If
End With
End Sub
Artik