Bonjour franck kengne, Isabelle,
tu a écrit :
le second fichier ... est d'une taille variable
je te laisse essayer ce fichier Excel (le code VBA est une adaptation de celui de sabV) :
ça s'adapte automatiquement à un nombre de lignes et colonnes variable ; j'ai volontairement évité l'utilisation de .CurrentRegion, car ça marcherait pas si tu as des lignes vides ou des colonnes vides intercalaires.
voici le code VBA :
Option Explicit
Sub remplace()
Dim rp As Range, plg As Range, m As Range
Dim c As Range, firstAddress$, n&, k%
Set rp = [Feuil1!B3:B12]
With Worksheets("Feuil2")
n = .Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
k = .Cells(2, Columns.Count).End(1).Column
Set plg = .[A2].Resize(n - 1, k)
End With
For Each m In rp
With plg
Set c = .Find(m, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Set c = .FindNext(c): c = 0
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next m
End Sub
Sub Reset()
[Feuil3!A2:D10].Copy [Feuil2!A2]
End Sub
dhany