Index equiv avec

Bonjour,

J'ai besoin d'aide , je n'arrive pas a trouve la solution de mon probleme.

Je souhaite faire comme un index equivalent mais avec une recherche d'une partie du mot

Dans ma colone A1 j'ai B007577PJA,B00GN21COM,B01936N73I si il contient B00GN21COM , il me donne le prix de mon index.

Voici mon fichier pour l'exemple.

10recherche.xlsx (12.26 Ko)

Bonjour,

à tester,

Sub test()
Set sh1 = Sheets("Feuille de travail")
Set sh2 = Sheets("Index de prix")

With sh1
 rw = .Cells(Rows.Count, 1).End(xlUp).Row
  For i = 2 To rw
   If Not IsError(Application.Search(",", .Cells(i, 1))) Then
        t = Split(Cells(i, 1), ",")
        For y = LBound(t) To UBound(t)
          p = Application.Index(sh2.Range("B:B"), Application.Match(t(y), sh2.Range("A:A"), 0))
          If Not IsError(p) Then .Cells(i, "B") = p: .Cells(i, "C") = t(y)
        Next y

   Else
        p = Application.Index(sh2.Range("B:B"), Application.Match(.Cells(i, 1), sh2.Range("A:A"), 0))
        If Not IsError(p) Then .Cells(i, "B") = p: .Cells(i, "C") = .Cells(i, 1)
   End If
  Next i
End With
End Sub

Bonjour jeromechant,

Voyez si la solution proposée dans le fichier joint peut vous aider

Rechercher des sujets similaires à "index equiv"