View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default SetFocus in user form

Try this one John

Private Sub UserForm_Activate()
With Me.TextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"John Tjia" wrote in message om...
I am creating a user form with a text box that starts with the number
0. I've got the userform_activate to set textbox1.setfocus so that
the cursor is in the text box. However, I find that the cursor is
blinking at the end of the 0, so that the user has to tap to the front
and then go forward to highlight the 0 in order to put in a new
number. How can I set it so that the 0 is highlighted right away, and
the user can input the right number over the 0 immediately?

Many thanks for advice!