Solved

List boxes

Posted on 2000-05-11
2
156 Views
Last Modified: 2010-05-02
Hi,

I have a list box full if items. I want to have a button that will add a number to each of the items. I.e. the first item is given the number 1, the second 2 and so on. The number given must be added at the beginning.

Cheers

Darude :)
0
Comment
Question by:darude
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 2801044
Private Sub Command1_Click()
    Dim i As Integer
    For i = 0 To List1.ListCount - 1
        List1.List(i) = (i + 1) & " " & List1.List(i)
    Next
End Sub
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2801818
<adding to Azra's very worthy comment>
Yikes.. better hope the List1.Sorted property is False.. <smile>.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now