[vba excel] ListBox1.ColumnWidths = AutoSize
bonjour a tous
voila je cherche à adapter la largeur de ma listbox en fonction de son contenu
j'ai excel 2000 j'utilise une listbox a deux colonnes
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub UserForm_Initialize()
NbDepartements = Range("E65536").End(xlUp).Row - 1
NbFournisseurs = WorksheetFunction.Sum(Range("F2:F65536"))
Sheets("Feuil2").Cells(1, 6) = NbFournisseurs
Sheets("Feuil2").Cells(1, 7) = NbDepartements
Label4.Caption = NbFournisseurs & " fournisseurs répartis dans " & _
NbDepartements & " départements"
For n = 2 To Range("E65536").End(xlUp).Row
ListBox1.AddItem (Range("E" & n))
ListBox1.List(i, 1) = Range("F" & n)
i = i + 1
Next n
End Sub
'¤¤¤¤COMMENT DOIS-JE CONFIGURER LA LARGEUR DE MES COLONNES?¤¤¤¤¤
'ListBox1.ColumnWidths = AutoSize ?? |
:pc: