bonjour,
peux tu m'aider a utiliser Rowsource ou list
Private Sub Remplir_ListBox()
Dim ws As Worksheet
Dim lastRow As Long, i As Long, j As Long
Dim tabValeurs() As Variant
Dim feuilleSelectionnee As String
lstf_Lignes.Clear
feuilleSelectionnee = cbf_GoToFeuille.Value
If feuilleSelectionnee = "" Then Exit Sub
Set ws = ThisWorkbook.Sheets(feuilleSelectionnee)
lastRow = ws.Cells(ws.Rows.count, "B").End(xlUp).Row
If lastRow < 6 Then Exit Sub ' Aucun contenu utile
tabValeurs = ws.Range("A6:AH" & lastRow).Value
lstf_Lignes.ColumnCount = 34
lstf_Lignes.ColumnWidths = "135 pt;136 pt;31,95 pt;" & String(31, "20 pt;")
' lstf_Lignes.ColumnWidths = "90;90;30;" & String(31, "20;")
' Colonnes : A=90, B=90, C=30, D:AH = 20 (x31) ? largeur totale ˜ 830
'Me.lstf_Lignes.ColumnWidths = "90;90;30;" & Join(Application.WorksheetFunction.Transpose(Split(String(31, "20,"))), ";")
lstf_Lignes.List = tabValeurs
Debug.Print "Nombre de lignes listées : "; lstf_Lignes.ListCount
End Sub
Edit modo : merci d'utiliser les balises de code en cliquant sur l'icone </> lorsque vous postez un code.