WORDCOUNT

WORDCOUNT(sText)
Returns the number of words in a string

sText

REMARKS
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

Public Function WORDCOUNT( _ 
         ByVal sText As String) _
         As Integer

Dim iReturn As Integer
Dim String_Length As Integer
Dim Current_Character As Integer

   String_Length = Len(sText)

   For Current_Character = 1 To String_Length

      If (Mid(sText, Current_Character, 1)) = " " Then
          iReturn = iReturn
      End If

   Next Current_Character

   WORDCOUNT = iReturn
End Function


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