ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlighting text in text box (https://www.excelbanter.com/excel-programming/279826-highlighting-text-text-box.html)

Craig Wilks[_2_]

Highlighting text in text box
 
Using SetFocus to have the cursor located in a text box each time, what
is the code to have the default text highlighted ready for a new entry
without first having to block or delete the existing textbox contents?

Craig Wilks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jan Karel Pieterse

Highlighting text in text box
 
Hi,

Set the enterfield behaviuor:

..EnterFieldBehavior = fmEnterFieldBehaviorSelectAll

Then use SetFocus to set the focus to it.

Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
Using SetFocus to have the cursor located in a text box

each time, what
is the code to have the default text highlighted ready

for a new entry
without first having to block or delete the existing

textbox contents?

Craig Wilks

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.



All times are GMT +1. The time now is 10:11 AM.

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