1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Private Sub UserForm_Initialize()
Dim rCol As Range
Dim rCell As Range
With Sheets("contrat")
Set rCol = Range(.[A2], .Cells(.Cells.SpecialCells(xlLastCell).Row, 1))
End With
Me.salsorti.ColumnCount = 5
Me.salsorti.ListStyle = fmListStyleOption
Me.salsorti.MultiSelect = fmMultiSelectMulti
Me.salsorti.IntegralHeight = True
Me.salsorti.ColumnHeads = True
Me.salsorti.ColumnWidths = "8cm;2cm;2cm;2.5cm;2.5cm"
For Each rCell In rCol
If rCell.Offset(0, 3) > 0 Then
Me.salsorti.AddItem rCell
Me.salsorti.List(Me.salsorti.ListCount - 1, 1) = rCell.Offset(0, 1)
Me.salsorti.List(Me.salsorti.ListCount - 1, 2) = rCell.Offset(0, 2)
Me.salsorti.List(Me.salsorti.ListCount - 1, 3) = rCell.Offset(0, 3)
End If
Next rCell
End Sub |
Partager