{"id":12098,"date":"2011-11-26T09:15:09","date_gmt":"2011-11-26T09:15:09","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=829"},"modified":"2011-11-26T09:15:09","modified_gmt":"2011-11-26T09:15:09","slug":"textbox-first-letter-in-caps","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/11\/textbox-first-letter-in-caps\/","title":{"rendered":"Textbox first Letter in Caps and Rest other in Lowercase"},"content":{"rendered":"
If you want to automatically make first letter in Uppercase and rest of the characters in lowercase. No matter what case you are typing-in but it will be automatically done by Copying and Pasting the below Code under KeyPress Event of the Textbox <\/strong><\/p>\n Read This Also:<\/strong><\/p>\n If you want to automatically make first letter in Uppercase and rest of the characters in lowercase. No matter what case you are typing-in but it will be automatically done by Copying and Pasting the below Code under KeyPress Event of the Textbox Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case Asc(“A”) To […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1674,1682],"tags":[],"class_list":["post-12098","post","type-post","status-publish","format-standard","hentry","category-macro","category-excel-macro-basics","category-popular-articles"],"yoast_head":"\n\n\nPrivate Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)\n\nSelect Case KeyAscii\nCase Asc(\"A\") To Asc(\"Z\")\n If InStr(1, TextBox1.Text, Chr(KeyAscii)) > 0 Or TextBox1.SelStart > 0 Then\n KeyAscii = Asc(LCase(Chr((KeyAscii.Value))))\n Else\n KeyAscii = Asc(UCase(Chr((KeyAscii.Value))))\n End If\n \nCase Asc(\"a\") To Asc(\"z\")\n If InStr(1, TextBox1.Text, Chr(KeyAscii)) > 0 Or TextBox1.SelStart > 0 Then\n KeyAscii = Asc(LCase(Chr((KeyAscii.Value))))\n Else\n KeyAscii = Asc(UCase(Chr((KeyAscii.Value))))\n End If\n \n Case Else\n End Select\n\nEnd Sub\n<\/code><\/pre>\n
\n