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
| Function Aucun_Mot_Commun(StrChamp1 As String, strChamp2 As String) As Boolean
dim var1 As Variant
dim var2 As Variant
dim i as integer
dim j as integer
dim tmpresult as Boolean
var1 = Split(strChamp1," ")
var2 = Split(strChamp2," ")
for i = 1 to Ubound(var1)
tmpresult= False
for j = 1 to Ubound(var2)
If var1(i) = var2(j) Then
tmpresult = True
End if
Next j
if tmpresult = True Then
'le mot i du champ1 existe dans le champ2
'on a bien au moins un mot en commun
Aucun_Mot_Commun = False
Exit Function
End if
Next i
Aucun_Mot_Commun = True
End Function |
Partager