{"id":12099,"date":"2011-11-26T10:35:22","date_gmt":"2011-11-26T10:35:22","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=846"},"modified":"2011-11-26T10:35:22","modified_gmt":"2011-11-26T10:35:22","slug":"how-to-force-proper-case-in-textbox","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/11\/how-to-force-proper-case-in-textbox\/","title":{"rendered":"How to force proper case in textbox"},"content":{"rendered":"

Proper Text is nothing but each word will have it’s first letter in caps. If you want to change every first letter of each word in a sentence then you can use StrConv<\/strong> function of VB in VBA.<\/p>\n

Syntax:<\/strong><\/p>\n

\"proper-case-text-box\"<\/p>\n

String(Mandatory)<\/strong><\/em> String is the String which you want to make in Proper Case.<\/p>\n

Conversion as StrConv(Mandatory):<\/strong><\/em> This is set of Conversion type which is available under this function. Below are the main types which are used frequently:-
\nvbLowerCase<\/em><\/span> This will convert string in lower case
\nvbUpperCase<\/em><\/span> This will convert string in Upper case
\nvbProperCase<\/em><\/span> This will convert string in Proper case<\/p>\n

LocaleID:<\/strong><\/em> This an optional input.
\nHow to make every first letter of a word in Capital letter of a Textbox:<\/strong> Copy and Paste the below code in Textbox Change Event. This is the simplest way to force proper case in textbox<\/strong><\/p>\n

Private Sub TextBox1_Change()\nTextBox1.Text = StrConv(TextBox1.Text, vbProperCase)\nEnd Sub<\/code><\/pre>\n

Read This Also:<\/strong><\/p>\n