I am new to VBA and I am using a code that will have a message box pop up if a value is less than another value. The box will appear if a check box is clicked, but if the value is less than the other specified value, I want the check box to uncheck itself. I know this is the reason why the message box comes up twice, but I don't know how to fix it.
Below is the my code:
Private Sub acpplan1_Click()
If TypeName(Sheet1.Range("AH64").Value) = "Error" Then Exit Sub
If Sheet1.Range("AH64").Value > Sheet4.Range("O11").Value Then
Application.EnableEvents = False
acpplan1.Value = False
Application.EnableEvents = True
MsgBox "The lowest minimum value plan offered does not meet the affordability test. Please reconsider employer contributions or choose alternative plans."
End If
End Sub
Any help would be much appreciated!
Below is the my code:
Private Sub acpplan1_Click()
If TypeName(Sheet1.Range("AH64").Value) = "Error" Then Exit Sub
If Sheet1.Range("AH64").Value > Sheet4.Range("O11").Value Then
Application.EnableEvents = False
acpplan1.Value = False
Application.EnableEvents = True
MsgBox "The lowest minimum value plan offered does not meet the affordability test. Please reconsider employer contributions or choose alternative plans."
End If
End Sub
Any help would be much appreciated!