1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Private Sub Workbook_Open()
Application.ScreenUpdating = False
With Application
.DisplayFullScreen = True
.DisplayStatusBar = False
.DisplayFormulaBar = False
End With
With ActiveWindow
.DisplayWorkbookTabs = False
.DisplayHeadings = False
.DisplayVerticalScrollBar = True
End With
ActiveSheet.Unprotect
Sheets("Listing").Select
Sheets("Listing").ScrollArea = "A1:Q80"
Range("A:Q").Select
ActiveWindow.Zoom = True
Range("K3").Select
ActiveSheet.Protect
Call arobase
Application.ScreenUpdating = True
Dim Cel As Range, iRow&, Périmés$, Certificat$, Règlement$
iRow = Range("L" & Rows.Count).End(xlUp).Row
For Each Cel In Range("L3:L" & iRow)
If Len(Cel) > 0 Then
If Date >= DateAdd("yyyy", 3, Cel.Value) Then
Périmés = Périmés & vbTab & Application.Proper(Cells(Cel.Row, "B")) & " " & UCase(Cells(Cel.Row, "C")) & " " & Application.Proper(Cells(Cel.Row, "D")) & vbCrLf
End If
End If
Next
MsgBox "Le certificat des personnes suivantes est périmé :" & vbCrLf & Périmés, vbExclamation, "Certificat Médical"
iRow = Range("M" & Rows.Count).End(xlUp).Row
For Each Cel In Range("M3:M" & iRow)
If Cel.Value = "" Then
Certificat = Certificat & vbTab & Application.Proper(Cells(Cel.Row, "B")) & " " & UCase(Cells(Cel.Row, "C")) & " " & Application.Proper(Cells(Cel.Row, "D")) & vbCrLf
End If
Next
MsgBox "Le certificat des personnes suivantes est attendu :" & vbCrLf & Certificat, vbExclamation, "Certificat"
iRow = Range("N" & Rows.Count).End(xlUp).Row
For Each Cel In Range("N3:N" & iRow)
If Cel.Value = "" Then
Règlement = Règlement & vbTab & Application.Proper(Cells(Cel.Row, "B")) & " " & UCase(Cells(Cel.Row, "C")) & " " & Application.Proper(Cells(Cel.Row, "D")) & vbCrLf
End If
Next
MsgBox "Le règlement des personnes suivantes est attendu :" & vbCrLf & Règlement, vbExclamation, "Règlement"
End Sub |