Sub Archive_Absence2()
'
Dim LigCible As Long, ColCible As Long, MaDateDebut As Long, MaDateFin As Long, lig As Long, col As Long, i As Long
Application.ScreenUpdating = False
MaDateDebut = CDate(UsfAjoutAbsence.TxtDebut)
MaDateFin = CDate(UsfAjoutAbsence.TxtFin)
With Sheets("Feuil1")
Set lig = Application.Union(.Range("2:2"), .Range("8:8")).Find(UsfAjoutAbsence.CbNom, LookIn:=xlValues, lookat:=xlWhole)
If lig Is Nothing Then Exit Sub
LigCible = lig.Row
Set col = Sheets("Feuil1").Range("1:1").Find(CDate(MaDateDebut), LookIn:=xlValues, lookat:=xlWhole) 'UsfAjoutAbsence.TxtDebut
If col Is Nothing Then Exit Sub
ColCible = col.Column
Sheets("Feuil1").Cells(LigCible + 1, ColCible).Resize(1, CDate(MaDateFin) - CDate(MaDateDebut) + 1).Select
Sheets("Feuil1").Cells(LigCible + 1, ColCible).Resize(1, CDate(MaDateFin) - CDate(MaDateDebut) + 1).Value = UsfAjoutAbsence.TxtInit
Sheets("Feuil1").Cells(LigCible + 2, ColCible).Resize(4, CDate(MaDateFin) - CDate(MaDateDebut) + 1).Value = 0
For i = MaDateDebut To MaDateFin
If Not Range("t_Feries[Date]").Find(what:=CDate(i)) Is Nothing Then
Sheets("Feuil1").Cells(LigCible + 1, ColCible + i - MaDateDebut).Value = "Férié"
End If
Next i
End With
End Sub