Excel text box properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box inserted in my worksheet from the Control Toolbox toolbar.

Is there an option which allows me to specify that existing text in the box
is overwritten by new entries (I have the number of possible characters
restricted so this would be very useful). I can't find one in the Properties
window so maybe the only solution is VBA?

Thanks
 
You can have this code when the text box gets the focus:

Private Sub TextBox1_GotFocus()

TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Value)

End Sub

(Replace TextBox1 by the name of your textbox, it appears four times)
 

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

Similar Threads

Wrap text 7
Excel 2007 Text Boxes 3
tab over in form 2
how do I "wrap text" in a combo box 1
Tabbing between text boxes in Excel 2007 1
Combo Box 1
Combo Box/Drop down box 1
toolbars: form vs control 1

Back
Top