?
Solved

VB6 - Sorting data alphabetically from a list box

Posted on 2003-02-26
6
Medium Priority
?
1,885 Views
Last Modified: 2010-08-05
Hey,
I have a list box with 30 surnames,
how do i sort the data alphabetically ?
0
Comment
Question by:billy_mac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 80 total points
ID: 8024329
in design mode

ListBox.sorted=true
0
 
LVL 1

Assisted Solution

by:sazhagianambi
sazhagianambi earned 80 total points
ID: 8024457
Hi,

        In List Box There is One Property called Sorted. If U Set this as Tru It will be Sorted Automatically.
        If You Have the Items in Array then Use the Following Logic,
Consider Arr as Array Having Set Of Strings

Dim Temp
 For i=0 to Ubound(Arr)
  For j=0 to UBound(Arr)
      If arr(i)>arr(j)
          temp=arr(i)
          arr(i)=arr(j)
          arr(j)=temp
      endif
  Next
 Next
Now Arr have the Sorted Elements.

Regards,
Nambi.
0
 

Author Comment

by:billy_mac
ID: 8025045
Nice one deighton and Nambi.
0
 

Expert Comment

by:CleanupPing
ID: 8901090
billy_mac:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8972945
Moderator, my recommended disposition is:

    Split points between: deighton and sazhagianambi

DanRollins -- EE database cleanup volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question