Private Sub Command1_Click()
Dim ss As String
Dim i As Integer
Dim i_Count As Integer
ss = "dasdas;dsadasads;sdds;sdsdsd;sdsdee;sdsdsd;dssdds"
i = 1
i_Count = 0
While i <> 0
i = InStr(i + 1, ss, ";")
i_Count = i_Count + 1
Wend
MsgBox i_Count - 1
End Sub
End Sub
Function GetCnt(str1 As String, str2 As String)
Dim pos1
pos1 = InStr(str1, str2)
Do While pos1 <> 0
GetCnt = GetCnt + 1
pos1 = InStr(pos1 + 1, str1, str2)
Loop