Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
michdenis
Bonjour FB,
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel) '------------------------ Sub SortListBox(oLb As MSForms.ListBox) Dim vaItems As Variant Dim i As Long, j As Long Dim vTemp As Variant
'Put the items in a variant array vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming 'with VBA to sort the array For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1 For j = i + 1 To UBound(vaItems, 1) If vaItems(i, 0) > vaItems(j, 0) Then vTemp = vaItems(i, 0) vaItems(i, 0) = vaItems(j, 0) vaItems(j, 0) = vTemp End If Next j Next i
'Clear the listbox oLb.Clear
'Add the sorted array back to the listbox For i = LBound(vaItems, 1) To UBound(vaItems, 1) oLb.AddItem vaItems(i, 0) Next i
End Sub '------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument SortListBox Me.Combobox1
Salutations!
"FB" a écrit dans le message de news: Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce domaine...
Merci pour toute aide apportée
Bonjour FB,
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel)
'------------------------
Sub SortListBox(oLb As MSForms.ListBox)
Dim vaItems As Variant
Dim i As Long, j As Long
Dim vTemp As Variant
'Put the items in a variant array
vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming
'with VBA to sort the array
For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1
For j = i + 1 To UBound(vaItems, 1)
If vaItems(i, 0) > vaItems(j, 0) Then
vTemp = vaItems(i, 0)
vaItems(i, 0) = vaItems(j, 0)
vaItems(j, 0) = vTemp
End If
Next j
Next i
'Clear the listbox
oLb.Clear
'Add the sorted array back to the listbox
For i = LBound(vaItems, 1) To UBound(vaItems, 1)
oLb.AddItem vaItems(i, 0)
Next i
End Sub
'------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument
SortListBox Me.Combobox1
Salutations!
"FB" <FB@discussions.microsoft.com> a écrit dans le message de news: 67BB63A6-11FD-45A4-B351-4EE5D6073C92@microsoft.com...
Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une
listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce
domaine...
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel) '------------------------ Sub SortListBox(oLb As MSForms.ListBox) Dim vaItems As Variant Dim i As Long, j As Long Dim vTemp As Variant
'Put the items in a variant array vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming 'with VBA to sort the array For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1 For j = i + 1 To UBound(vaItems, 1) If vaItems(i, 0) > vaItems(j, 0) Then vTemp = vaItems(i, 0) vaItems(i, 0) = vaItems(j, 0) vaItems(j, 0) = vTemp End If Next j Next i
'Clear the listbox oLb.Clear
'Add the sorted array back to the listbox For i = LBound(vaItems, 1) To UBound(vaItems, 1) oLb.AddItem vaItems(i, 0) Next i
End Sub '------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument SortListBox Me.Combobox1
Salutations!
"FB" a écrit dans le message de news: Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce domaine...
Merci pour toute aide apportée
FB
Merci à toi michdenis je vais me renseigner pour me procurer les livres de john walkenbach ....
Merci
Bonjour FB,
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel) '------------------------ Sub SortListBox(oLb As MSForms.ListBox) Dim vaItems As Variant Dim i As Long, j As Long Dim vTemp As Variant
'Put the items in a variant array vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming 'with VBA to sort the array For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1 For j = i + 1 To UBound(vaItems, 1) If vaItems(i, 0) > vaItems(j, 0) Then vTemp = vaItems(i, 0) vaItems(i, 0) = vaItems(j, 0) vaItems(j, 0) = vTemp End If Next j Next i
'Clear the listbox oLb.Clear
'Add the sorted array back to the listbox For i = LBound(vaItems, 1) To UBound(vaItems, 1) oLb.AddItem vaItems(i, 0) Next i
End Sub '------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument SortListBox Me.Combobox1
Salutations!
"FB" a écrit dans le message de news: Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce domaine...
Merci pour toute aide apportée
Merci à toi michdenis
je vais me renseigner pour me procurer les livres de john walkenbach ....
Merci
Bonjour FB,
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel)
'------------------------
Sub SortListBox(oLb As MSForms.ListBox)
Dim vaItems As Variant
Dim i As Long, j As Long
Dim vTemp As Variant
'Put the items in a variant array
vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming
'with VBA to sort the array
For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1
For j = i + 1 To UBound(vaItems, 1)
If vaItems(i, 0) > vaItems(j, 0) Then
vTemp = vaItems(i, 0)
vaItems(i, 0) = vaItems(j, 0)
vaItems(j, 0) = vTemp
End If
Next j
Next i
'Clear the listbox
oLb.Clear
'Add the sorted array back to the listbox
For i = LBound(vaItems, 1) To UBound(vaItems, 1)
oLb.AddItem vaItems(i, 0)
Next i
End Sub
'------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument
SortListBox Me.Combobox1
Salutations!
"FB" <FB@discussions.microsoft.com> a écrit dans le message de news: 67BB63A6-11FD-45A4-B351-4EE5D6073C92@microsoft.com...
Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une
listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce
domaine...
Merci à toi michdenis je vais me renseigner pour me procurer les livres de john walkenbach ....
Merci
Bonjour FB,
IL y a ceci provenant de John Walkenbach(Auteur de nombreux livres sur excel) '------------------------ Sub SortListBox(oLb As MSForms.ListBox) Dim vaItems As Variant Dim i As Long, j As Long Dim vTemp As Variant
'Put the items in a variant array vaItems = oLb.List
'Steal code from John Walkenbach's Excel Power Programming 'with VBA to sort the array For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1 For j = i + 1 To UBound(vaItems, 1) If vaItems(i, 0) > vaItems(j, 0) Then vTemp = vaItems(i, 0) vaItems(i, 0) = vaItems(j, 0) vaItems(j, 0) = vTemp End If Next j Next i
'Clear the listbox oLb.Clear
'Add the sorted array back to the listbox For i = LBound(vaItems, 1) To UBound(vaItems, 1) oLb.AddItem vaItems(i, 0) Next i
End Sub '------------------------
Pour appeler cette procédure, il s'agit s'appeler cette dernère en passant un Combobox comme argument SortListBox Me.Combobox1
Salutations!
"FB" a écrit dans le message de news: Me revoila avec mon tri de listbox.....
Bjr tout le monde
Est ce que quelqu'un connais un routine vba pour trié le contenu d'une listbox (situé dans un userform) sans passé par une feuille excel
il faut certainement passé par les array mais j'y connais rien dans ce domaine...