bwait
05-02-2019, 03:30 PM
Hi,
I am using Marlett checkboxes to implement three mutually-exclusive checkboxes (columns A, B, and C). I found some Worksheet code that makes these mutually exclusive (for example, checking A1, clears A1:C1, then sets A1 to Marlett "a"). But, I want the checkboxes on a row to be optional as well as mutually-exclusive. For example, a user can check box A or B or C, or none of them. The code I have wont allow this. Any ideas how to implement this?
Thanks
Brad
Here is the code I am using:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Column >= 1 And Target.Column <= 4 Then
If Not Intersect(Target, Range("A" & Target.Row & ":C" & Target.Row)) Is Nothing Then
Target.Font.Name = "Marlett"
Range("A" & Target.Row & ":C" & Target.Row).ClearContents
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End If
End Sub
I am using Marlett checkboxes to implement three mutually-exclusive checkboxes (columns A, B, and C). I found some Worksheet code that makes these mutually exclusive (for example, checking A1, clears A1:C1, then sets A1 to Marlett "a"). But, I want the checkboxes on a row to be optional as well as mutually-exclusive. For example, a user can check box A or B or C, or none of them. The code I have wont allow this. Any ideas how to implement this?
Thanks
Brad
Here is the code I am using:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Column >= 1 And Target.Column <= 4 Then
If Not Intersect(Target, Range("A" & Target.Row & ":C" & Target.Row)) Is Nothing Then
Target.Font.Name = "Marlett"
Range("A" & Target.Row & ":C" & Target.Row).ClearContents
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End If
End Sub