Sub Dimensionner(o As Object)
Dim mem$, i&, L#
Application.ScreenUpdating = False
Application.EnableEvents = False
o.AutoSize = True
mem = o
For i = 0 To UBound(o.List)
o.ListIndex = i
If o.Width > L Then L = o.Width
Next
o.AutoSize = False
o.Width = L
o = mem
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Dimensionner ComboBox1
Sub Dimensionner(o As Object)
Application.ScreenUpdating = False
With Columns(Columns.Count)
.Resize(o.ListCount) = o.List
.Font.Name = o.Font.Name
.Font.Size = o.Font.Size
.Font.Bold = o.Font.Bold
.Font.Italic = o.Font.Italic
.AutoFit
o.Width = .Width + 16
.Delete
End With
Application.ScreenUpdating = True
End Sub
Sub Dimensionner1(o As Object)
Dim mem1$, mem2#, i&, L#
Application.ScreenUpdating = False
Application.EnableEvents = False
mem1 = o: mem2 = o.Width
o.AutoSize = True
For i = 0 To UBound(o.List)
o.ListIndex = i
If o.Width > L Then L = o.Width
Next
o.AutoSize = False
o = mem1: o.Width = mem2
o.ListWidth = Application.Max(72, L + 16 * (o.ListCount <= o.ListRows))
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Sub Dimensionner2(o As Object)
Application.ScreenUpdating = False
With Columns(Columns.Count)
.Resize(o.ListCount) = o.List
.Font.Name = o.Font.Name
.Font.Size = o.Font.Size
.Font.Bold = o.Font.Bold
.Font.Italic = o.Font.Italic
.AutoFit
o.ListWidth = Application.Max(72, .Width - 16 * (o.ListCount > o.ListRows))
.Delete
End With
Application.ScreenUpdating = True
End Sub
Sub Dimensionner1(o As Object)
Dim mem1$, mem2#, i&, L#
Application.ScreenUpdating = False
Application.EnableEvents = False
mem1 = o: mem2 = o.Width
o.AutoSize = True
For i = 0 To UBound(o.List)
o.ListIndex = i
If o.Width > L Then L = o.Width
Next
o.AutoSize = False
o = mem1: o.Width = mem2
o.ListWidth = Application.Max(72, 10 + L + 16 * (o.ListCount <= o.ListRows))
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Sub Dimensionner2(o As Object)
Application.ScreenUpdating = False
With Columns(Columns.Count)
.Resize(o.ListCount) = o.List
.Font.Name = o.Font.Name
.Font.Size = o.Font.Size
.Font.Bold = o.Font.Bold
.Font.Italic = o.Font.Italic
.AutoFit
o.ListWidth = Application.Max(72, 6 + .Width - 16 * (o.ListCount > o.ListRows))
.Delete
End With
Application.ScreenUpdating = True
End Sub