Textbox value automatically selected, How?

  • Thread starter Thread starter Kevlar
  • Start date Start date
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
 
Kevlar

Try


Private Sub UserForm_Activate()
Me.TextBox1.SelStart = 0
Me.TextBox1.SelLength = Len(Me.TextBox1)
End Su
 
That works well. Thanks

Now, how do I get the list of choices in a listbox to default to th
top ite
 
Option Explicit
Private Sub UserForm_Initialize()
Me.ListBox1.ListIndex = 0
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top