Solved

List boxes

Posted on 2000-05-11
2
182 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modifying Conditional Format from VBA code 3 72
TT Auto Dashboard 13 101
VB6 ListBox Question 4 57
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 38
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

726 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