Sub Complete(Optional b As Byte)
Dim T As Variant, i As Integer
Dim Dt0 As Double, lg As Integer, cl As Integer
Ecrit = True
Application.ScreenUpdating = False
With Sheets("Agenda")
.Range("C3:AG26").ClearContents
Dt0 = .Range("C2").Value
T = Range("T_Bdd").ListObject.DataBodyRange 'Message d'erreur ici
On Error GoTo suite
For i = 1 To UBound(T)
If T(i, 2) >= Dt0 And T(i, 2) < Dt0 + 7 And T(i, 3) >= .Range("B4").Value Then
lg = 4 + ((T(i, 3) - .Range("B4").Value) * 24 * 2)
cl = 3 + T(i, 2) - Dt0
.Cells(lg, cl + 24).Value = T(i, 1)
.Cells(lg, cl).Value = T(i, 5)
End If
suite:
Next i
On Error GoTo 0
End With
Application.ScreenUpdating = True
Ecrit = False
End Sub