Private Sub TextBox1_Change()
'utilise UCase pour que la casse ne soit pas prise en compte
Dim txt$, d As Object, i%, c$, j%, n%
txt = TextBox1
With ListBox1
.Clear
If txt <> "" Then .AddItem 'encadre la liste
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To Len(txt)
c = Mid(txt, i, 1)
If c <> " " And Not d.Exists(UCase(c)) Then
d(UCase(c)) = UCase(c)
n = 0
For j = i To Len(txt)
If UCase(Mid(txt, j, 1)) = UCase(c) Then n = n + 1
Next
.AddItem c & " = " & n
End If
Next
If txt <> "" Then .AddItem 'encadre la liste
.Height = Application.Max(18, (.Font.Size + 2) * .ListCount + 2)
DoEvents
Me.Height = .Height + 105
End With
End Sub