Count Words in a Textbox

  • Thread starter Thread starter Baapi
  • Start date Start date
B

Baapi

Hi,

I would like to count the number of words in a textbox (Comments)
(Forms) and display it in another textbox (WC) (wordcount should be
dynamic - as the user keeps typing, result should get updated)

Girish:)
 
Private Sub Textbox1_Change()
Dim numwords as Long
numwords = Len(Textbox1.Text) -
len(replace(Application.Trim(Textbox1.Text)," ","")) + 1
Textbox2.Text = numWords
End Sub
 
Back
Top