我目前已将其设置为无法同时检查两个复选框,如果是,则会弹出错误并再次取消选中该复选框。但是目前它正在弹出两次消息。如何解决这个问题?
Private Sub CheckBox1_Click()
If CheckBox2.Value = True Then
MsgBox "Must be sent separate."
CheckBox1.Value = False
End If
End Sub
答案 0 :(得分:1)
我认为您只需要更改它:原因是它在切换checkbox1时运行检查
Private Sub CheckBox1_Click()
If CheckBox2.Value = True And CheckBox1.Value = True Then
MsgBox "Must be sent separate."
CheckBox1.Value = False
End If
End Sub