moving through items in listboxes

R

revduke123

HI all,

I'm using Office 2004, and trying to use a listbox to enable user to
choose an item - in this case, a filename from a list of filenames.
The code is below.
The form opens up fine, the list of files appears fine, you can use
the up/down arrows to select items; but I can't get the 'matching'
feature to work. As soon as you press any other key, the selection
jumps to the top of list. I want the selection to jump to the first
occurrence of the phrase tha the user types in, using the 'complete
match' process

Any ideas what I'm doing wrong?
Thanks for any help.
Revduke

Sub testuserform()

dirlist ' this sub sticks a directory listing into a string array
called file_names
BubbleSort (file_names) 'now I sort it
Load UserForm1
UserForm1.ListBox1.MatchEntry = fmMatchEntryComplete
UserForm1.ListBox1.ColumnCount = 1
UserForm1.ListBox1.List() = file_names
UserForm1.ListBox1.TextColumn = 1
UserForm1.Show
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

Top