View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
jasonsweeney[_42_] jasonsweeney[_42_] is offline
external usenet poster
 
Posts: 1
Default Parsing out text entries in a text box

Tom,

I changed the number from 250 to 20 in the code you sent me to test
when somebody reaches the limit....

With the code as I copied above, I got an error....I just erased the
offending line, and now it works....my code now is:

____________
Private Sub plaintextbox_Change()
Dim varr
ReDim varr(0 To 1)
varr = Split(plaintextbox.Text, " ")
wordcount.Caption = UBound(varr)
If UBound(varr) - 1 = 14 Then
MsgBox "You are reaching the limit of 20 words"
ElseIf UBound(varr) - 1 = 20 Then
MsgBox "You have reached the limit of 20 words"
ReDim Preserve varr(0 To 19)
End If
__________________

Also, on the space as a word issue. If I just hit the space bar, the
spaces count as words. What appears to be happening is that a space
occuring after a word is considered "part" of the preceding word.
Weird.


---
Message posted from http://www.ExcelForum.com/