'Option Compare Text 'activer pour ignorer la casse
Function Ecarts%(text1$, text2$)
Dim i%, x$, j%
For i = Len(text1) To 1 Step -1
x = Mid(text1, i, 1)
For j = 1 To Len(text2)
If Mid(text2, j, 1) = x Then
text1 = Left(text1, i - 1) & Mid(text1, i + 1)
text2 = Left(text2, j - 1) & Mid(text2, j + 1)
Exit For
End If
Next j, i
Ecarts = Len(text1) + Len(text2)
End Function