bonjour le forum
eriiic m'a fait un code pour éliminer les combinaisons d'un fichier par rapport à la base de données qui fonctionne trés bien,mais je voudrais l'adapter a un autre fichier qui lui va compter 20 colonnes pour la BdD et 10 col pour le fichier a trier et j'ai oublié de lui demander quel valeurs il fallait changer pource nouveau fichier.
Avant la BdD etait en colA acolE maintenant elle sera en colA a colT
pour le fichier a trier il sera en colV a colAE.
Sub eliminer()
Dim derlig1 As Long, lig1 As Long, col1 As Long
Dim derlig2 As Long, lig2 As Long
Dim c As Range, cpt As Long
derlig1 = Cells(Rows.Count, 1).End(xlUp).Row
derlig2 = Cells(Rows.Count, 7).End(xlUp).Row
'
Application.ScreenUpdating = False
lig2 = 1
Do While lig2 <= derlig2
For lig1 = 1 To derlig1
cpt = 0
For col1 = 1 To 5
Set c = Cells(lig2, 7).Resize(1, 5).Find(Cells(lig1, col1).Value, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
cpt = cpt + 1
End If
If cpt = 3 Then Exit For
Next col1
If cpt = 3 Then
Cells(lig2, 7).Resize(1, 6).Delete Shift:=xlUp
derlig2 = derlig2 - 1
Exit For
End If
Next lig1
If cpt < 3 Then lig2 = lig2 + 1
Loop
Application.ScreenUpdating = True
'End Sub
Range("AD2").Select
End Sub
merci