Advertisement
Guest User

Untitled

a guest
May 31st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2. Dim i As Integer
  3. i = 2
  4.  
  5. Do While (Cells(i, 2) <> "")
  6. If Cells(i, 2) = "Муж." And (DateDiff("yyyy", Cells(i, 4), Date) > 60) Then
  7. Cells(i, 1) = Null
  8. Cells(i, 2) = Null
  9. Cells(i, 3) = Null
  10. Cells(i, 4) = Null
  11. Cells(i, 5) = Null
  12. Cells(i, 6) = Null
  13. Cells(i, 7) = Null
  14. ElseIf Cells(i, 2) = "Жен." And (DateDiff("yyyy", Cells(i, 4), Date) > 55) Then
  15. Cells(i, 1) = Null
  16. Cells(i, 2) = Null
  17. Cells(i, 3) = Null
  18. Cells(i, 4) = Null
  19. Cells(i, 5) = Null
  20. Cells(i, 6) = Null
  21. Cells(i, 7) = Null
  22. End If
  23. i = i + 1
  24. Loop
  25. MsgBox " сотрудники пенсионного возраста были удалены"
  26. End Sub
  27.  
  28. Private Sub CommandButton2_Click()
  29. Unload Me
  30. End Sub
  31. удаление
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement