Bonjour
Je regardes un peu ce sujet et je voudrais savoir
Si dans ID on a 21/23/21/203/203/999/21
Est ce possible (plusieurs fois le même numéro-des numéros inexistants) ?
Si oui quels seraient les résultats pour FIXTURE, LINE, ADDRESS, AMP et WEIGHT ?
Si non comment traiter ces cas ?
En plus avant d'aller plus loin il faudrait tester ce code pour savoir si compatible ou pas
Remplace la fonction existante par celle-ci
Function RechercheTYPE(Nom As Range) As String
Dim I As Integer, J As Long, K As Integer, Indice As Integer
Dim TabloSource, TabloFixture(), Tablo
Dim WsS As Worksheet
Dim Msg As String
Application.Volatile
Set WsS = Worksheets("PATCH")
TabloSource = WsS.Range("B2:E" & WsS.[B65536].End(xlUp).Row)
If Not IsEmpty(Nom) Then
Tablo = SplitFor97(CStr(Nom), "/")
For I = 1 To UBound(Tablo)
For J = 1 To UBound(TabloSource)
If TabloSource(J, 1) Like Tablo(I) Then
For K = 1 To Indice
If TabloFixture(2, K) = TabloSource(J, 2) Then
TabloFixture(1, K) = TabloFixture(1, K) + 1
Exit For
End If
Next K
If K > Indice Then
Indice = Indice + 1
ReDim Preserve TabloFixture(1 To 2, 1 To Indice)
TabloFixture(1, Indice) = 1
TabloFixture(2, Indice) = TabloSource(J, 2)
End If
Exit For
End If
Next J
Next I
End If
For I = 1 To Indice
Msg = Msg & "/" & TabloFixture(1, I) & " " & TabloFixture(2, I)
Next I
RechercheTYPE = Mid(Msg, 2)
End Function
Ensuite rajoutes cette fonction
'from Tom Ogilvy
Function SplitFor97(sStr As String, sdelim As String) As Variant
SplitFor97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function
Parce si ce n'est pas compatible, ce n'est plus la peine que je continue
.