Greetings!

I have created a userform to input athlete information. I am trying to setup maximum and minimum limits on a calculated textbox on a userform. The textbox (txtBenchMax) is calculated from two other textboxes (txtBenchReps and txtBenchWeight). In addition, the limits will need to change based on yet another listbox entry (lstGender). For example, if the athlete is a female, the upper and lower limits for Bench Max is between 60 and 220. However, if the athlete is male, the upper and lower limits for Bench Max is 100 and 425.

I would like a message box to appear if txtBenchReps value falls outside of the limits.

This is what I have so far (for female only). I have it to the point where the message box will appear upon exiting the txtBenchMax textbox, but this happens whether or not the entry is within the limit or not...and it does not take into account the lstGender entry.

Any and all suggestions are much appreciated.

Private Sub txtBenchMax_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Select Case False
Case lstGender.Value = "F" And txtBenchMax.Value > 220
MsgBox "Bench max outside limits for female.", vbOKOnly
txtBenchWeight.SetFocus
Case lstGender.Value = "F" And txtBenchMax.Value < 60
MsgBox "Bench max outside limits for female.", vbOKOnly
txtBenchWeight.SetFocus
End Select
End Sub

This is the code I have for the txtBenchMax calculation:

Private Sub txtBenchReps_Change()
If cboBenchReps.Value = "" Then Exit Sub
If txtBenchWeight.Value = "" Then Exit Sub
txtBenchMax.Value = (CDbl(cboBenchReps.Value) * (0.03) * CDbl(txtBenchWeight.Value)) + (CDbl(txtBenchWeight.Value))
End Sub

Private Sub txtBenchWeight_Change()
If cboBenchReps.Value = "" Then Exit Sub
If txtBenchWeight.Value = "" Then Exit Sub
txtBenchMax.Value = (CDbl(cboBenchReps.Value) * (0.03) * CDbl(txtBenchWeight.Value)) + (CDbl(txtBenchWeight.Value))
End Sub