ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel text box properties (https://www.excelbanter.com/excel-discussion-misc-queries/152871-excel-text-box-properties.html)

R Ormerod

Excel text box properties
 
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
--
R Ormerod

squenson via OfficeKB.com

Excel text box properties
 
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)

--
Message posted via http://www.officekb.com



All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com