Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Private Sub CheckStartLast()
  2.  
  3. '''''<<<<< Check for error: Employee's last day cannot be before start day.
  4.  
  5. payroll_Start = UserForm9.ComboBox21.Value
  6. payroll_Last = UserForm9.ComboBox22.Value
  7. payroll_Diff = WorksheetFunction.IfError(payroll_Last - payroll_Start, "-Check-")
  8.  
  9. Select Case payroll_Diff
  10. Case Is = "-Check-"
  11. Exit Sub
  12. Case Is >= 0
  13. Exit Sub
  14. Case Is < 0
  15. MsgBox "Employee's start date cannot be after their last day. Doesn't make sense. Does it to you?"
  16. Case Else
  17. Exit Sub
  18. End Select
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement