Re : vba:Comparer lignes de bdd et afficher résultats
Bebere, Fhoest, le Fil,
Bebere,
j'ai enfin reussi à adapter,
le bug venait en effet des formules affichant #valeur!
Comment puis-je faire pour double clicker sur les résultats et utiliser les numéros de lignes concernés pour afficher et consulter mon USF RechetCréaPijesMandat !?
As tu une idée!?
Ici, les résultats de recherche correspondent à un filtre via VBA, je ne peux donc après utiliser toutes les infos de ma bdd!
il me manque notamment:
le tel et le nom du vendeur!
peux t'on au moins rajouter celà dans l'extraction viale code que tu as crée?!
Fhoest, en recherche auto,
j'ai eu beau essayer de modifier le code de comparaison de lignes et reduire les paramètres critères de recherche,
les résultats ne sont pas cohérents par rapport au premier critère qui est le prix
je te re soumet le code:
#Sub TrouverLignesIdentiques()
MsgBox "la recherche est assez longue, patientez", vbInformation
Dim MyString As String, MyStringbdd As String
Dim maligne As Long, MesLignes As Integer
Dim i, j, fin_de_ligne, maplage1 As Long
Dim Maplage2, Maplage3, Maplage4, Maplage5, Maplage6 As String
Dim mem_maplage1_moins, mem_maplage1_plus As Long
With Sheets("bdd vendeurs")
fin_de_ligne = .Range("b65532").End(xlUp).Row
i = 1
For j = 5 To fin_de_ligne
maligne = 4
maplage1 = .Range("C" & maligne).Value
mem_maplage1_moins = Val(maplage1 - (maplage1 / 100) * 5)
mem_maplage1_plus = Val(maplage1 + (maplage1 / 100) * 5)
Maplage2 = .Range("P" & maligne).Text & " " & .Range("Q" & maligne).Text & " " & _
.Range("R" & maligne).Text & " " & .Range("S" & maligne).Text & " " & .Range("T" & maligne).Text
Maplage3 = Range("V" & maligne)
Maplage4 = Range("X" & maligne).Text & " " & .Range("Y" & maligne).Text & " " & _
.Range("Z" & maligne).Text & " " & .Range("AA" & maligne).Text & " " & .Range("AB" & maligne).Text
'Maplage5 = Range("AD" & maligne)
'Maplage6 = Range("AE" & maligne).Text & " " & .Range("AF" & maligne).Text & " " & _
'.Range("AG" & maligne).Text & " " & .Range("AH" & maligne).Text & " " & .Range("AI" & maligne).Text & " " & _
'.Range("AJ" & maligne).Text & " " & .Range("AK" & maligne).Text & " " & .Range("AL" & maligne).Text & " " & _
'.Range("AM" & maligne).Text & " " & .Range("AN" & maligne).Text & " " & .Range("AO" & maligne).Text & " " & _
'.Range("AP" & maligne).Text
MyString = Maplage2 & " " & Maplage3 & " " & Maplage4 '& " " & Maplage5 & " " & Maplage6
maligne = j
maplage1 = Range("C" & maligne).Value
Maplage2 = Range("P" & maligne).Text & " " & .Range("Q" & maligne).Text & " " & _
.Range("R" & maligne).Text & " " & .Range("S" & maligne).Text & " " & .Range("T" & maligne).Text
Maplage3 = Range("V" & maligne)
Maplage4 = Range("X" & maligne).Text & " " & .Range("Y" & maligne).Text & " " & _
.Range("Z" & maligne).Text & " " & .Range("AA" & maligne).Text & " " & .Range("AB" & maligne).Text
'Maplage5 = Range("AD" & maligne)
'Maplage6 = Range("AE" & maligne).Text & " " & .Range("AF" & maligne).Text & " " & _
'.Range("AG" & maligne).Text & " " & .Range("AH" & maligne).Text & " " & .Range("AI" & maligne).Text & " " & _
'.Range("AJ" & maligne).Text & " " & .Range("AK" & maligne).Text & " " & .Range("AL" & maligne).Text & " " & _
'.Range("AM" & maligne).Text & " " & .Range("AN" & maligne).Text & " " & .Range("AO" & maligne).Text & " " & _
'.Range("AP" & maligne).Text
MyStringbdd = Maplage2 & " " & Maplage3 & " " & Maplage4 '& " " & Maplage5 & " " & Maplage6
If i = j Then GoTo ici
'If mem_maplage1_moins < maplage1 < mem_maplage1_plus Then
If mem_maplage1_moins < maplage1 < mem_maplage1_plus Or .Range("C4").Value = maplage1 Then
If MyString = MyStringbdd Then
Moteurrecherchebien.ListBoxauto.AddItem maplage1 & " " & MyString & "numero de ligne " & maligne
ici:
End If
End If
Next j
End With
MsgBox "fin de la comparaison"
End Sub
Sub ici(X As String)
Dim L As Long
L = Range("feuil1!a65532").End(xlUp).Row + 1
Range("feuil1!a" & L) = X
End Sub#
Merci à vous deux et bonne fin de journée
🙂