Sub Bouton1_Clic()
For j = 1 To Range("A65535").End(xlUp).Row
For i = 1 To Len(Cells(j, 1)) - 10
compare = UCase(Mid(Cells(j, 1), i, 10))
If WorksheetFunction.Search(compare, UCase(Cells(j, 2))) Then
Cells(j, 3) = LCase(compare)
Exit For
End If
Next i
Next j
End Sub
J'aurais besoin de ce comportement exact (fichier attaché)
Si string commun entre cellules Cx et Dx (10 caractères minimum) ....
Bonjour et merci pour vos questions.
*Les caractères doivent etre collés (et non séparés)
Merci
Bonsoir
C'est à dire ? Un exemple...
@ plus
Function Commun(Contenant, Contenu)
Dim i As Long, Trouve As Boolean
Trouve = False
For i = 1 To Len(Contenu) - 10
If UCase(Contenant) Like "*" & UCase(Mid(Contenu, i, 10)) & "*" Then
Trouve = True
Exit For
End If
Next i
Commun = IIf(Trouve, "Commun", "")
End Function