Salut Theze,
J'ai testé ta solution mais je ne dois pas positionner le complément au bon endroit car j'ai droit au message d'erreur "end sub attendu".
Pourtant je l'ai bien mis à la fin...
Sub Filtre()
Dim ClBDD As Workbook
Dim ClProjet As Workbook
Dim Plage As Range
Dim Cel As Range
Dim Critere As String
Set ClBDD = Workbooks("BDD.xlsx")
Set ClProjet = Workbooks("Projet1.xlsx")
Critere = ClProjet.Worksheets("2018").Range("B2").Value
Function DefPlage(Fe As Worksheet, Optional L As Long = 1, Optional C As Long = 1) As Range
On Error GoTo Fin
With Fe
Set DefPlage = .Range(.Cells(L, C), _
.Cells(.Cells.Find("*", .[A1], -4123, , _
1, 2).Row, .Cells.Find("*", .[A1], -4123, , _
2, 2).Column))
End With
Exit Function
Fin:
Set DefPlage = Nothing
End Function
Set Plage = DefPlage(ClBDD.Worksheets("2018"))
Plage.AutoFilter 2, "=" & Critere
ClBDD.Worksheets("2018").AutoFilter.Range.EntireRow.Copy ClProjet.Worksheets("2018").Range("A1")
Plage.AutoFilter
End Sub
J'ai essayé en enlevant "function" et "and function", mais pas mieux