View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Maxi[_2_] Maxi[_2_] is offline
external usenet poster
 
Posts: 94
Default find mid value of string data in data with integers

Why 65 to 71?

I also did not understand the line "If Range(Chr(x) & i).Text = v Then"


llama wrote:
Maxi

This should solve your problem, strValString is your string of numbers
("1,2,3,4")

Function FindFreq(strValString As String)

Dim iFreq As Integer
Dim iCount As Integer

For i = 1 To 5

For x = 65 To 71

For Each v In Split(strValString, ",")

If Range(Chr(x) & i).Text = v Then
iCount = iCount + 1
End If

Next
Next

If iCount 2 Then
iFreq = iFreq + 1
End If

iCount = 0

Next

Debug.Print iFreq


End Function

Paul