954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to change all first letter of the words in the textbox to uppercase?

Hi,

I try to change all first letter of the words in the textbox to uppercase.
THis how far i try to change it but just the first word not the entire words.

Private Sub txtQuote_Change()
  txtQuote.Text = UCase$(Left(txtQuote.Text, 1)) & LCase$(Mid$(txtQuote.Text, 2))
  txtQuote.SelStart = Len(txtQuote.Text)
End Sub


Please Help.
Best regards

Thank you.

dnk
Light Poster
49 posts since Dec 2007
Reputation Points: 35
Solved Threads: 0
 

Why not use StrConv()

See if this helps :

Private Sub txtQuote_Change()
  txtQuote.Text = StrConv(txtQuote.Text, vbProperCase)
  txtQuote.SelStart = Len(txtQuote.Text)
End Sub
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Solved.

dnk
Light Poster
49 posts since Dec 2007
Reputation Points: 35
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: