Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cursor Location
Hello all,
I have a text box on a form. In the text box, I do not allow someone to use the "#" symbol, but using the method I use, when I remove the symbol after someone tries to use it, the cursor is restored to the beginning of the string or not at all. I would like the cursor to be at the end of the string so the user can just continue typing after dismissing the error box. Here is the code I'm using: Private Sub txtValue_Change() If Right(txtValue, 1) = "#" Then MsgBox "You may not use the ""#"" symbol for this value!", vbOKOnly + vbExclamation, "Invalid Character..." txtValue = Left(txtValue, Len(txtValue) - 1) txtValue.SetFocus End If End Sub Does anyone know how I can programmatically tell the cursor to go to the end of the string in the textbox on focus? Thanks for any advice, Jack |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to determine cursor location? | Excel Discussion (Misc queries) | |||
Tracking cursor location | Excel Worksheet Functions | |||
Function for cursor location | Excel Worksheet Functions | |||
Cursor location between grouped worksheets | Excel Discussion (Misc queries) | |||
Cursor Location | Excel Discussion (Misc queries) |