Je voudrais les voir apparaître dès le l'ouverture de l'userform.
Nb = Sheets("FONCTIONS").Range("G1").Value
With Me.ListBox1
.ColumnCount = 2
.ColumnWidths = "250;0"
End With
UserForm2.ListBox1.Clear
For i = 0 To Nb - 1
With Me.ListBox1
Données = Sheets("FONCTIONS").Range("F" & i + 5).Value
Lettre = UCase(Left(Données, 1))
If LettreSelect = Lettre Then 'comparaison lettre du bouton..
X = X + 1
.AddItem
.List(i, 0) = Données
.List(i, 1) = i + 5
End If
End With
Next
With Me.ListBox1
For i = 0 To Nb - 1
Données = Sheets("FONCTIONS").Range("F" & i + 5).Value
.AddItem
.List(i, 0) = Données
.List(i, 1) = i + 5
Next
End With
Dim Plages As Range
Dim Cell As Range
Set Plages = Sheets("fonctions").Range("A5:I" & DerLigne)
With Me.ListBox1
TextBox7 = Plages(.List(.ListIndex, 1) - 4, 1)
TextBox13 = Plages(.List(.ListIndex, 1) - 4, 2)
TextBox14 = Plages(.List(.ListIndex, 1) - 4, 5)
End With
UserForm2.ListBox1.Clear
[COLOR="Red"]J = 0
For i = 1 To Nb
With Me.ListBox1
Données = Sheets("FONCTIONS").Range("F" & i + 5).Value
Lettre = UCase(Left(Données, 1))
If LettreSelect = Lettre Then 'comparaison lettre du bouton..
X = X + 1
.AddItem
.List(J, 0) = Données
.List(J, 1) = i + 5
J = J + 1
End If
End With
Next[/COLOR]
'--------------------- Tri sur Listbox ------------------------------
Sub Bouton_Choisi(LettreSelect)