Link to home
Start Free TrialLog in
Avatar of jocktherock
jocktherock

asked on

How to sort a ListBox on a UserForm in Word VBA?

I have a list of files which are insterted as Sub-Documents in a Master Document.  The file names are read into a ListBox on a UserForm.  However, they appear in the ListBox in Created Date order.  There doesn't seem to be a "Sort By" property on the ListBox, and there doesn't seem to be a Sort Method for the ListBox.
At the moment, I have to ask the end user to assemble the final order by selecting one at a time and building up the final order in a second ListBox on the same UserForm  -  OK if there are only 10 or a dozen sub-documents, but I know there's one coming up with over 100....!
Anyone have any ideas, please?
(Reasonable experience of VBA in Access and Excel, but not quite so good in Word).
All help gratefully received...!

Ed
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jocktherock
jocktherock

ASKER

Excellent!  Worked first time!  I had tried passing the List to an Array, but couldn't get any further than that....!
And the solution came back very rapidly.
Many, many thanks!


Ed