Kod:
Private Sub deneme(metin As String)
Dim dict As Object
Set dict = CreateObject("Scripting.Dictionary")
Dim metin As String
Dim strMetin() As String
Dim i As Integer
strMetin = Split(metin, " ")
For i = 0 To UBound(strMetin)
If dict.Exists(strMetin(i)) Then
dict(strMetin(i)) = dict(strMetin(i)) + 1
Else
dict.Add strMetin(i), 1
End If
Next
Dim maxi As Integer
Dim strMaxi As String
Dim intMaxi As Integer
Dim say As Integer
maxi = 0
intMaxi = 0
say = 0
Dim key As Variant
For Each key In dict.Keys
If (maxi < dict(key)) Then
maxi = dict(key)
strMaxi = key
intMaxi = say
End If
say = say + 1
Next key
MsgBox dict.Keys()(intMaxi) & ";" & dict.Items()(intMaxi)
End Sub