Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlighting Textbox
I have a userform with a Textbox that starts off with an initial value
read in from a cell. After taking the user to the textbox I want the value withing it to be highlighted. This code does not solve it.. _______________________________________ Private Sub UserForm_Initialize() TextBox1.Text = Worksheets("blad1").Cells(5, 1) TextBox1.SetFocus End Sub _______________________________________ Any ideas? Garry Jones |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlighting Textbox
Garry,
If you want to highlight (select) the text in a textbox, use the SelStart and SelLength properties. E.g., With Userform1.TextBox1 .SelStart = 0 .SelLength = Len(.Text) .SetFocus End With -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Garry Jones" wrote in message ... I have a userform with a Textbox that starts off with an initial value read in from a cell. After taking the user to the textbox I want the value withing it to be highlighted. This code does not solve it.. _______________________________________ Private Sub UserForm_Initialize() TextBox1.Text = Worksheets("blad1").Cells(5, 1) TextBox1.SetFocus End Sub _______________________________________ Any ideas? Garry Jones |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate Textbox value based on another textbox value.doc | Excel Discussion (Misc queries) | |||
Calculate Textbox value based on another textbox value | Excel Discussion (Misc queries) | |||
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. | Excel Discussion (Misc queries) | |||
Highlighting or Selecting TextBox entry | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |