WORDCOUNT


Function counts the number of words in a string 'by looking at each character and seeing whether it is a space or not Number_of_Words = 0

Function Number_of_Words(Text_String As String) As Integer 
Dim String_Length As Integer
Dim Current_Character As Integer

String_Length = Len(Text_String)

For Current_Character = 1 To String_Length

If (Mid(Text_String, Current_Character, 1)) = " " Then
    Number_of_Words = Number_of_Words + 1 End If

Next Current_Character
End Function




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext