Encore une erreur qui me dépasse.
Sub Alerte()
'
' Alerte Macro
'
Dim w1 As Worksheet
Dim I As Long
Dim D As Date
Dim J As Integer
Dim Listebus As String
Dim Listecmu As String
Dim Listefinatjm As String
Dim Listetravail As String
Dim Listeregularisation As String
Dim Rep As Integer
Set w1 = Worksheets("Effectif") 'Feuille qui contient les alertes
D = Date
' ********************************* fin de BUS
For I = 3 To w1.Range("AF" & Rows.Count).End(xlUp).Row
Select Case w1.Cells(I, "AF").Value
Case "Néant"
'ici le code prévu à cet effet ou rien
Case Else
ladate = w1.Range("AF" & I)
If ladate <> "" Then
p = D - ladate
If p >= 0 Then Listebus = Listebus & vbLf & "L'abonnement de bus pour " & Cells(I, "C").Value & " a expiré depuis le " & Cells(I, "AF")
End If
End Select
Next I
' ********************************* fin de CMU
For I = 3 To w1.Range("AB" & Rows.Count).End(xlUp).Row
ladate = w1.Range("AB" & I)
If ladate <> "" Then
p = D - ladate
If p >= 0 Then Listecmu = Listecmu & vbLf & "La CMU pour " & Cells(I, "C").Value & " est expirée depuis le " & Cells(I, "AB")
If p > -30 And p < 0 Then Listecmu = Liste & vbLf & "La CMU pour " & Cells(I, "C").Value & " expirera le " & Cells(I, "AB").Value
End If
Next I
' ********************************* fin d'ATJM
For I = 3 To w1.Range("V" & Rows.Count).End(xlUp).Row
ladate = w1.Range("V" & I)
If ladate <> "" Then
p = D - ladate
If p >= 0 Then Listefinatjm = Listefinatjm & vbLf & "L'ATJM pour " & Cells(I, "C").Value & " est expirée depuis le " & Cells(I, "V").Value
If p > -60 And p < 0 Then Listefinatjm = Listefinatjm & vbLf & "L'ATJM pour " & Cells(I, "C").Value & " expirera le " & Cells(I, "V").Value
End If
Next I
' ********************************* Régularisation
For I = 3 To w1.Range("L" & Rows.Count).End(xlUp).Row
ladate = w1.Range("L" & I)
If Cells(I, 27).Value <> "" Then
If ladate <> "" Then
p = D - ladate <= ICI
If p >= 0 Then Listeregularisation = Listeregularisation & vbLf & "La demande de titre de séjour pour " & Cells(I, "C").Value & " devrait être envoyée depuis depuis le " & Cells(I, "V").Value
If p > -60 And p < 0 Then Listeregularisation = Listeregularisation & vbLf & "La demande de titre de séjour pour " & Cells(I, "C").Value & " devra être envoyée avant le " & Cells(I, "V").Value
End If
End If
Next I
' ********************************* Fin d'autorisation de travail
For I = 3 To w1.Range("AU" & Rows.Count).End(xlUp).Row
ladate = w1.Range("AU" & I)
If ladate <> "" Then
p = D - ladate
If p >= 0 Then Listetravail = Listetravail & vbLf & "L'autorisation de travail pour " & Cells(I, "C").Value & " est expirée depuis le " & Cells(I, "AU").Value
If p > -60 And p < 0 Then Listravail = Listetravail & vbLf & "L'autorisation de travail pour " & Cells(I, "C").Value & " expirera le " & Cells(I, "AU").Value
End If
Next I
Rep = MsgBox(Listecmu, vbExclamation + vbOKCancel, "Mise à jour des CMU demandée")
If Rep = vbCancel Then Exit Sub
Rep = MsgBox(Listebus, vbExclamation + vbOKCancel, "Abonnements de bus périmés")
If Rep = vbCancel Then Exit Sub
Rep = MsgBox(Listefinatjm, vbExclamation + vbOKCancel, "ATJM à renouveler")
If Rep = vbCancel Then Exit Sub
Rep = MsgBox(Listeregularisation, vbExclamation + vbOKCancel, "Demande titre de séjour à faire")
Rep = MsgBox(Listetravail, vbExclamation + vbOKCancel, "Autorisations de travail à renouveler")
If Rep = vbCancel Then Exit Sub
'
End Sub
Je présume que cette erreur ne provient pas le cette macro mais de la colonne L qui est issue d'une formule afin d'avoir la date de majorité.