1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Function Domaine(Description As String)
Dim Derli_dom As Long, i As Long, cara As Long
Dim t
Derli_dom = Feuil9.Columns(1).Find("*", , , , , xlPrevious).Row
t = Feuil9.Range(Feuil9.Cells(1, 2), Feuil9.Cells(Derli_dom, 1))
cara = 0
For i = 2 To Derli_dom
'If Description.Value Like "*" & Feuil9.Range("A" & i).Value & "*" Then
If Description Like "*" & t(i, 1) & "*" Then
'If Len(Feuil9.Range("A" & i).Value) > cara Then
If Len(t(i, 1)) > cara Then
cara = Len(t(i, 1))
'Domaine = Feuil9.Range("A" & i).Value
Domaine = t(i, 1)
End If
End If
Next
End Function |
Partager