Count Words in a Textbox

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:)
 
T

Tom Ogilvy

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top