Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a form with a text box containing a date formatted as mm/dd/yyyy.
When the box gets focus, I want the mm/dd part to be selected for replacement. So far, I have the following: Private Sub TextBox1_Enter() TextBox1.SelStart = 0 TextBox1.SelLength = 5 End Sub Private Sub UserForm_initialize() TextBox1.Value = "01/01/4000" TextBox2.Value = "04/03/1999" End Sub When the form comes up, textbox1 has focus and 01/01 is highlighted. But when I press <enter, <tab, or click on a text box to enter it, it seems that '_Enter()' doesn't fire at that time. How can I get the first 5 characters highlighted every time I enter the text box? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to determine the text selection? | Excel Discussion (Misc queries) | |||
Text Alighnment Across Selection | Excel Discussion (Misc queries) | |||
Text selection will not turn off | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
losing text from text box when pasting selection to word | Excel Discussion (Misc queries) |