desole mais j pa vu ta réponseBonjour Habitude,
Pour moi j'avoue que j'ai rien compris,
@ 13:29 j'ai lui demande de nous fournir un fichier exemple avec resultats souhaites...
@ 14:19 il a changer son message vers : PHP
??????
Function ANALYSE$(txt$, ordre%)
'utilise UCase pour que la casse ne soit pas prise en compte
Dim d As Object, i%, c$, n%
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)
If d.Count = ordre Then Exit For
End If
Next
If d.Count < ordre Then Exit Function
For i = 1 To Len(txt)
If UCase(Mid(txt, i, 1)) = UCase(c) Then n = n + 1
Next
ANALYSE = c & " = " & n
End Function
=ANALYSE($A2;COLONNES($B2:B2))
Sub AnalyseTexte()
'utilise UCase pour que la casse ne soit pas prise en compte
Dim txt$, mes$, d As Object, i%, c$, j%, n%
txt = InputBox("Entrer le texte à analyser :", "Analyser")
If txt = "" Then Exit Sub
mes = "Il n'est pas tenu compte de la casse" & vbLf & vbLf & _
"Texte analysé : " & txt & vbLf
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
mes = mes & vbLf & c & " = " & n
End If
Next
MsgBox mes, , "Analyse"
End Sub
merci merci du font du cœur chere amiRe ahcene,
A votre service.
Fichier (2).Code:Sub AnalyseTexte() 'utilise UCase pour que la casse ne soit pas prise en compte Dim txt$, mes$, d As Object, i%, c$, j%, n% txt = InputBox("Entrer le texte à analyser :", "Analyser") If txt = "" Then Exit Sub mes = "Il n'est pas tenu compte de la casse" & vbLf & vbLf & _ "Texte analysé : " & txt & vbLf 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 = 1 To Len(txt) If UCase(Mid(txt, j, 1)) = UCase(c) Then n = n + 1 Next mes = mes & vbLf & c & " = " & n End If Next MsgBox mes, , "Analyse" End Sub
Bonne nuit
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
Mais l'essentiel, c'est qu'il n'a pas oublie de dire que le prob est Resolu...Vous avez effacé le texte original du post #1 !!!
Soyez gentil remettez-le pour que des visiteurs comprennent le problème