Userform text box formatting

  • Thread starter Thread starter Jock
  • Start date Start date
J

Jock

Is it possible to force Proper Case for any text typed into a User Form text
box?
Thanks.
 
No. But you can change it whenever you want--when the user leaves the textbox
(Textbox1_AfterUpdate???)
 
As long as your TextBox will not contain too much text (things might get
sluggish otherwise), you can probably use this KeyUp event code to do what
you want...

Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim Position As Long
Position = TextBox1.SelStart
TextBox1.Text = StrConv(TextBox1.Text, vbProperCase)
TextBox1.SelStart = Position
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

Back
Top