Sorting a Listbox

S

Steve C

I have a list box (lstProjects) on a user form that is populated by a text
file. I need help with code that would sort the listbox in alphabetical
order. Thanks for any assistance you can give me!
 
J

Jean-Guy Marcil

Steve C said:
I have a list box (lstProjects) on a user form that is populated by a text
file. I need help with code that would sort the listbox in alphabetical
order. Thanks for any assistance you can give me!

Dump the listbox content in an Array and then sort the array. Then you can
dump the array back into the listbox.

For sorting an array, see:
http://word.mvps.org/faqs/macrosvba/SortArray.htm
 

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