Adrienne80
New Member
- Joined
- May 10, 2020
- Messages
- 7
- Office Version
- 2019
- Platform
- Windows
I have this code that enables or automatically selects checkboxes based on user selections in the cell in column T. The checkboxes are in 3 separate columns. This works great on checkboxes 1,2, & 3 (on the first line of the worksheet) But it does not work on any line after that. How can I make this code work on any line after this? There are over 100 lines on the worksheet. I've tried many different codes, but can't seem to find any that work. Thanks in advance!
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "T17" Then
If Target.CountLarge > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
Select Case LCase(Target.Value)
Case "prosurance"
Me.CheckBox1.Value = True
Me.CheckBox2.Value = True
Me.CheckBox3.Value = True
Case "care"
Me.CheckBox1.Enabled = True
Me.CheckBox2.Value = False
Me.CheckBox3.Value = False
Case "mi only"
Me.CheckBox1.Enabled = False
Me.CheckBox2.Enabled = False
Me.CheckBox3.Enabled = False
Case "pm only"
Me.CheckBox1.Enabled = False
Me.CheckBox2.Enabled = False
Me.CheckBox3.Enabled = False
Case "assurance"
Me.CheckBox1.Enabled = True
Me.CheckBox2.Enabled = True
Me.CheckBox3.Enabled = True
End Select
End If
End Sub