Figured it out!
Since the data entered is in a form and I am adding the data from the form to a spreadsheet, I simply had the "ADD button perform a few checks before adding the data. See my soultion below
Private Sub cmdAdd_Click()
'report error if no data entered
ElseIf txtSide.Text = "" Then
MsgBox "Must enter Side Panel Thickness!", vbOKOnly, "Error"
ElseIf txtSide.Value < "0.92" Then
MsgBox "STOP PRODUCTION!!! Side Panel measurement out of Spec Limits. Contact Supervisor.", vbOKOnly, "Error"
ElseIf txtSide.Value > "1.08" Then
MsgBox "STOP PRODUCTION!!! Side Panel measurement out of Spec Limits. Contact Supervisor.", vbOKOnly, "Error"
'record into spreadsheet
Application.ScreenUpdating = False
Sheets("Data").Select
Password = "1234"
ActiveSheet.Unprotect Password
Selection.AutoFilter Field:=1
ActiveCell.SpecialCells(xlLastCell).Select
Selection.End(xlToLeft).Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = txtSide.Text
Selection.End(xlToLeft).Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Password = "1234"
ActiveSheet.Protect Password, True, True, True
Sheets("Userform").Select
ActiveWorkbook.Save
End
Application.ScreenUpdating = True
End If
End Sub
Bookmarks