Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a textbox on a userform that is validated before updating. The
problem is that after an invalid date is entered by the user, the focus returns to the textbox but it is not activated--i.e., no keyboard input is accepted except the tab key and shift tab. I want the textbox selected or a cursor present so that the user can reenter data into the textbox. (By the way, the routine below works the same even when omitting the lines containing SelStart, SelLength, and SetFocus.) Private Sub StartDate_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) Dim mytext As String mytext = CheckDateEntry(StartDate) If mytext = "invalid" Then Cancel = True StartDate.SelStart = 0 StartDate.SelLength = Len(StartDate.Text) StartDate.SetFocus End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Highlight all Text in a Textbox when the textbox is selected | Excel Programming | |||
How to move cursor from one textbox control to another textbox con | Excel Programming | |||
How to move cursor from one textbox control to another textbox con | Excel Programming | |||
getting the cursor to show in a textbox | Excel Programming | |||
cursor selected range from a text box | Excel Programming |