don't forget tripple and on and on.
Printable View
don't forget tripple and on and on.
Im sorry, please explain more what you want.
With a little rearranging of Martin Liss' code:
Code:Private Sub Command1_Click()
Dim vArray As Variant
Dim intIndex As Integer
Dim intSpaces As Integer
vArray = Split(Text1.Text, " ")
For intIndex = 0 To UBound(vArray)
intSpaces = intSpaces + 1
Next
MsgBox "Spaces = " & intSpaces - 1
End Sub
using Matthew's code:
If text1.text = me 4 spaces me 10 spaces me
the code will give you 14 spaces which is correct but
you can't count the words as there are only 3 words.
So as you can see, it is no solution. Your first answer is the best one.
Ps..for future reference, you should post the one question and stay with it so people can know what is happening insead of making 3 or 4 different post concerning questions as per the answers in your first post.
later