erictaveren
New Member
- Joined
- Aug 6, 2018
- Messages
- 3
Hello,
I've got a command button on userform that is checking a lot of options with one click. One of the things I need it to check is if all the OptionButtons (6 of them) are deselected. If so, a cell needs to populate a value. If any are clicked, I need it to move on to the rest of its task. This is what I found online to help. Obviously I don't want to leave the sub if any are checked, that's one problem. My second problem is that whether or not something is checked my cell gets populated. Does anyone have a solution?
If OptionButton1.Value = Checked _
Or OptionButton2.Value = Checked _
Or OptionButton3.Value = Checked _
Or OptionButton4.Value = Checked _
Or OptionButton5.Value = Checked _
Or OptionButton6.Value = Checked Then
Exit Sub
Else: Sheets("Sheet2").Range("AC1") = "Denied for all retention workouts."
End If
I've got a command button on userform that is checking a lot of options with one click. One of the things I need it to check is if all the OptionButtons (6 of them) are deselected. If so, a cell needs to populate a value. If any are clicked, I need it to move on to the rest of its task. This is what I found online to help. Obviously I don't want to leave the sub if any are checked, that's one problem. My second problem is that whether or not something is checked my cell gets populated. Does anyone have a solution?
If OptionButton1.Value = Checked _
Or OptionButton2.Value = Checked _
Or OptionButton3.Value = Checked _
Or OptionButton4.Value = Checked _
Or OptionButton5.Value = Checked _
Or OptionButton6.Value = Checked Then
Exit Sub
Else: Sheets("Sheet2").Range("AC1") = "Denied for all retention workouts."
End If