Application.Volatile
On Error Resume Next
With Sheets("G032")
L = Application.Match(ID, .[A:A], 0)
If IsError(L) Then
Retard = "Erreur sur ID."
Exit Function
End If
Retard = ""
For C = 6 To 13 Step 2 ' De la colonne F à M
If .Cells(L, C + 1) = "" Then ' Si date réelle vide
If .Cells(L, C) < Now Then ' Si répassée : Retard
Retard = .Cells(1, C) ' Retour = Phase
Exit Function
End If
End If
Next C
End With
End Function
Function Prochain(ID)
Application.Volatile
On Error Resume Next
With Sheets("G032")
L = Application.Match(ID, .[A:A], 0)
If IsError(L) Then
Prochain = "Erreur sur ID."
Exit Function
End If
Prochain = ""
For C = 6 To 13 Step 2 ' De la colonne F à M
If .Cells(L, C + 1) = "" Then ' Si date réelle vide
If .Cells(L, C) >= Now And .Cells(L, C) <= Now + 15 Then ' Si date sous 15 jours
Prochain = .Cells(1, C) ' Prochain = phase
Exit Function
End If
End If
Next C
End With
End Function