Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- Dim i As Integer
- i = 2
- Do While (Cells(i, 2) <> "")
- If Cells(i, 2) = "Муж." And (DateDiff("yyyy", Cells(i, 4), Date) > 60) Then
- Cells(i, 1) = Null
- Cells(i, 2) = Null
- Cells(i, 3) = Null
- Cells(i, 4) = Null
- Cells(i, 5) = Null
- Cells(i, 6) = Null
- Cells(i, 7) = Null
- ElseIf Cells(i, 2) = "Жен." And (DateDiff("yyyy", Cells(i, 4), Date) > 55) Then
- Cells(i, 1) = Null
- Cells(i, 2) = Null
- Cells(i, 3) = Null
- Cells(i, 4) = Null
- Cells(i, 5) = Null
- Cells(i, 6) = Null
- Cells(i, 7) = Null
- End If
- i = i + 1
- Loop
- MsgBox " сотрудники пенсионного возраста были удалены"
- End Sub
- Private Sub CommandButton2_Click()
- Unload Me
- End Sub
- удаление
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement