Hi all . i am trying to sort a listbox while filling the listbox in ascending order. My current code sorts like this :
1013
1034
716
717
829
830
but i want to sort them like this:
716
717
829
830
1013
1034
could you guys help me sort like above.Thanks
Code:Private Sub Command2_Click() Dim hrefSPLIT() As String Dim strItem As Integer '''''''''''' Dim doc As HTMLDocument Dim aHref As HTMLAnchorElement Set doc = WebBrowser1.Document For Each aHref In WebBrowser1.Document.All.tags("A") If InStr(aHref.href, "http://www.somesite.com/en/programs/") Then aHref.href = Replace(aHref.href, "http://www.somesite.com/en/programs/", "") hrefSPLIT = Split(aHref.href, "/") Text6.Text = hrefSPLIT(0) aHref.href = Replace(aHref.href, hrefSPLIT(0) & "/", "") hrefSPLIT = Split(aHref.href, "/") Text11.Text = Val(hrefSPLIT(0)) strItem = Text11.Text List1.AddItem CInt(strItem) End If Next aHref End Sub


Reply With Quote
