I have a user form that when data entry is complete, I what to check that the values are correct. If they are not, I what the form to stay open, and messages to tell the user what to fix.
How should I write the code this is what I have, & I'm not getting what I need?
Private Sub Com_Apply_Click()
'chech values
If Range("d15").Value > Range("d16").Value = True Then
MsgBox "Alignment Start Station must be equal to or less then Alignment End Station"
Else
Unload Me
End If
If Range("d15").Value > Range("d16").Value = True Then
MsgBox "Alignment End Station must be equal to or Greater then Alignment Start Station"
Else
Unload Me
End If
If Range("E16").Value > 0 = True Then
MsgBox "Alignment Offset Left must be less then -0"
Else
Unload Me
End If
If Range("F17").Value > "0" = True Then
MsgBox "Alignment Offset Left must be Greater then 0"
Else
Unload Me
End If
End Sub
Bookmarks