Private Sub txb1_Change()
Static flag As Boolean, L& 'variables mémorisées
If flag Then Exit Sub
Dim P As Range, x$, i As Variant
Set P = Range("A1:A7") 'plage à adapter
x = txb1
i = Application.Match(x & "*", P, 0)
If x <> "" And IsNumeric(i) Then
If Len(x) < L Then x = Left(x, Len(x) + IsError(Application.Match(x, P, 0))) 'si effacement
flag = True
txb1 = Left(P(i), Len(x) + 1)
flag = False
txb1.SelStart = Len(x)
txb1.SelLength = 1 'dernier caractère en surbrillance
End If
L = Len(txb1)
End Sub