VB Code:
Dim str1 As String str1 = Text1.Text Do While InStr(str1, " ") > 0 str1 = Replace(str1, " ", " ") Loop 'To count no. of words MsgBox Len(str1) - Len(Replace(str1, " ", "")) + 1 'To count no. of characters (with spaces) MsgBox Len(str1) 'To count no. of characters (without spaces) MsgBox Len(Replace(str1, " ", "")) 'To count no. of semi-colons or any other character MsgBox Len(str1) - Len(Replace(str1, ";", ""))




icon on the left of the post.
Reply With Quote