voilà le code que j'ai essayé d'élabore mais bon... ça ne fonctionne pas.
Merci
Public Sub test()
Dim oShFeuil2 As Worksheet
Dim oShFeuil1 As Worksheet
Dim bFin As Boolean
Dim iLig As Integer
Dim dtDeb As Date
Dim iLigEcrite As Integer
Set oShFeuil1 = Worksheets("Feuil1")
Set oShFeuil2 = Worksheets("Feuil2")
dtDeb1 = oShFeuil2.Range("H2").Value
dtDeb2 = oShFeuil2.Range("H3").Value
dtDeb3 = oShFeuil2.Range("H4").Value
dtDeb4 = oShFeuil2.Range("H5").Value
dtDeb5 = oShFeuil2.Range("H6").Value
dtDeb6 = oShFeuil2.Range("H7").Value
dtDeb7 = oShFeuil2.Range("H8").Value
dtDeb8 = oShFeuil2.Range("H9").Value
dtDeb9 = oShFeuil2.Range("H10").Value
dtDeb10 = oShFeuil2.Range("H11").Value
dtFin = oShFeuil1.Range("H12").Value
iLigEcrite = 12
bFin = False
iLig = 2
While Not bFin
If DateDiff("d", dtDeb1, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb2, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb3, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb4, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb5, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb6, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb7, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb8, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb9, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtDeb10, oShFeuil2.Range("A" & iLig).Value) = 0 Then
If DateDiff("d", dtFin, oShFeuil2.Range("A" & iLig).Value) = 0 Then
oShFeuil1.Range("F" & iLigEcrite).Value = oShFeuil2.Range("B" & iLig).Value
iLigEcrite = iLigEcrite + 1
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
iLig = iLig + 1
If oShFeuil2.Range("A" & iLig).Value = "" Then
bFin = True
End If
Wend
Set oShFeuil2 = Nothing
Set oShFeuil1 = Nothing
MsgBox "test ok !", vbInformation
End Sub