Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Control Question
I have fifteen text boxes in my userform. They have a default value of
zero. When my form loads, the first text box has the focus. I want to highlight or select the zero so when I enter a number into the text box it will overwrite the zero rather then put the number after the zero. I can't figure out the code I need to highlight the zero. The following text boxes highlight the zero automatically when I press enter in the previous text boxes. So I just need to be able select the first text boxes zero. Any help will be appreciated. Thanks in advance. By the way I have excel 2003. Thanks, Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Control Question
This UserForm Initialize event code should do what you want...
Private Sub UserForm_Initialize() With TextBox1 .SelStart = 0 .SelLength = Len(.Text) End With End Sub -- Rick (MVP - Excel) "Mark Knutson" wrote in message ... I have fifteen text boxes in my userform. They have a default value of zero. When my form loads, the first text box has the focus. I want to highlight or select the zero so when I enter a number into the text box it will overwrite the zero rather then put the number after the zero. I can't figure out the code I need to highlight the zero. The following text boxes highlight the zero automatically when I press enter in the previous text boxes. So I just need to be able select the first text boxes zero. Any help will be appreciated. Thanks in advance. By the way I have excel 2003. Thanks, Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting control on userform with part of control name (set question) | Excel Programming | |||
Quick syntax question- bolding userform control text via VBA | Excel Programming | |||
Control Sequence from Userform Control | Excel Programming | |||
Flow of control in VBA Question - Userform Interaction | Excel Programming | |||
Userform control | Excel Programming |