Bonjour à tous ,
Mon code ne fonctionne pas et il me met la ligne ci dessous en jaune :
col = ThisWorkbook.Sheets("matrice 1").Row(1).Find(DateToFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False).Column
Sub prévision()
Dim champ As Range
Dim DateToFind As String
Dim cel As Range
Dim col As Long
DateToFind = DateSerial(Year(Date), Month(Date), 1)
Set champ = Sheets("BDD1").Range("AL:AL").End(xlDown)
For Each cel In champ
col = ThisWorkbook.Sheets("matrice 1").Row(1).Find(DateToFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False).Column
Sheets("matrice 1").UsedRange.AutoFilter X, "FDR"
Dim lig As Long
lig = ThisWorkbook.Sheets("matrice 1").Range("R:R").SpecialCells(xlVisible).Find(cel.Value, LookAt:=xlWhole, MatchCase:=False).Row
cel.Offset(0, 17).Value = Sheets("matrice 1").Cells(lig, col).Value
Next cel
End Sub
Cordialement