Textbox value automatically selected, How?

K

Kevlar

This has to be a simple one.

When opening a userform I would like the value stored in the firs
textbox to be selected. Therefore I can just start typing over th
current value. Currently I have to click and drag the mouse over th
old value to select it
 
M

mudraker

Kevlar

Try


Private Sub UserForm_Activate()
Me.TextBox1.SelStart = 0
Me.TextBox1.SelLength = Len(Me.TextBox1)
End Su
 
K

Kevlar

That works well. Thanks

Now, how do I get the list of choices in a listbox to default to th
top ite
 
D

Dave Peterson

Option Explicit
Private Sub UserForm_Initialize()
Me.ListBox1.ListIndex = 0
End Sub
 
Top