If ligne <= UBound(tDates) Then
' la date de la tâche a bien été trouvée
ligne = ligne + 15 ' la ligne concernée
colA = 6 + 4 * (Format(t(i, 2), "hh") - HeurDeb)
colA = colA + Int(Format(t(i, 2), "nn") / 15) ' la colonne de début
If colA < Cells(1, "f").Column Then colA = Cells(1, "f").Column ' on limite colA à la colonne F (min)
colB = 6 + 4 * (Format(t(i, 3), "hh") - HeurDeb)
colB = colB + Int(Format(t(i, 3), "nn") / 15) - 1 ' la colonne de fin
If colB > Cells(1, "be").Column Then colB = Cells(1, "be").Column ' on limite colB à la colonne BE (max)
If colA <= colB Then
With Range(Cells(ligne, colA), Cells(ligne, colA)).Resize(, colB - colA + 1)
.Interior.ColorIndex = t(i, 1) ' Mise en forme
.Font.ColorIndex = t(i, 1)
.Value = t(i, 4)
End With
End If
End If