Code:
For b = 1 To 5 a(b) = InputBox("Input Grade") ListBox1.Items.Add(a(b)) Next ListBox1.Sorted = True
then it displays ( 100,93,94,96,98 )
but it should be (100,98,96,94,9 3)
thanks in advance.
For b = 1 To 5 a(b) = InputBox("Input Grade") ListBox1.Items.Add(a(b)) Next ListBox1.Sorted = True
Dim List As New List(Of Integer) 'Add ListBox Items to List For Each ListBoxItem In ListBox1.Items List.Add(ListBoxItem) Next 'Sort the List and Clear the ListBox List.Sort() ListBox1.Items.Clear() 'Add to ListBox Ascending For Each ListItem In List ListBox1.Items.Add(ListItem) Next 'Add to ListBox Descending For i = List.Count - 1 To 0 Step -1 ListBox1.Items.Add(List(i)) Next
Comment