473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sort Listbox with second column vbTab

Dear Guru
how can i sort listbox with vbTab my code is

Expand|Select|Wrap|Line Numbers
  1. Dim i As Long, TPts As Long, LPts As Long
  2.  Dim User As String, LText As String
  3.  If List2.ListCount = 0 Then                     'default, just enter & exit
  4.   List2.AddItem Text5.Text & vbTab & Text6.Text
  5.   Exit Sub
  6.  End If
  7.  LText = LCase$(Text5.Text)                      'case sensitive search
  8.  TPts = Val(Text6.Text)                          'text points
  9.  For i = 0 To List1.ListCount - 1
  10.   User = Split(List2.List(i), vbTab)(0)          'user in list
  11.   LPts = LCase$(Split(List2.List(i), vbTab)(1))  'list points
  12.   If LCase$(User) = LText Then                   'in list?
  13.    List2.List(i) = User & vbTab & LPts + TPts    'yes, set updated score
  14.  
  15.    Exit Sub                                      ' & exit
  16.   End If
  17.  Next
  18.  List2.AddItem Text5.Text & vbTab & Text6.Text   'not found so enter
  19.  
i want to sort second column poin score bigger is in the top any help please
thanks
Apr 1 '14 #1
0 957

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ray | last post by:
Folks, I have just created a simple procedure that does the following: Determines the width of the columns of a listbox. Places a button of the correct size above each column as the form opens....
1
by: Mamatha | last post by:
Hi I have one VB.NET application with the listview control.i saved the contents of one column only when i click on the save button.Now i want to save the contents of second column also,how can...
4
by: tneufeld | last post by:
I am using a ListView control to display 2 columns of data that I populate manually. I can get the data in the first column easily enough. its when i try to get the data in the second column...
4
by: rn5a | last post by:
Can the items in a ListBox be sorted by the name of the items? The ListBox actually lists all directories & files existing in a directory on the server. Note that all the directories should be...
0
by: Alan T | last post by:
Can I or how do I display the second column as checkboxes in Listview?
1
by: psaroudakis | last post by:
Hello... I have been trying to sort a gtktreelist column that contains dates in the following format: eg: 01-Jan-1993 12-Dec-1992 etc i don't seem to be able to find any other solution than...
3
lotus18
by: lotus18 | last post by:
Hello World It's me again. LOL, I know how to get the selected item on the second column of a listview. frmCourses.lvwCourses.SelectedItem().SubItems(2) But I don't know how to do it with...
2
by: gnewsgroup | last post by:
I have a GridView, in which the header of one column changes depending on the selected value of a DropDownList outside of this GridView. I did this dynamic header through protected void...
0
by: premtolani | last post by:
Hello, Can you tell me how to sort a datetime column in any datetime format in a swt table ? the datetime format can be any. regards, Prem
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.