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 26 27 28 29 30 31 32 33 34 35
| Private Sub CommandButton1_Click()
Dim plage As Range
Set plage = ThisWorkbook.Worksheets("Mouvement").Range("H11:H" & [A65536].End(xlUp).Row)
Set plage1 = ThisWorkbook.Worksheets("Mouvement").Range("G11:G" & [A65536].End(xlUp).Row)
Monchiffre = CDbl(UserForm10.TextBox1.Value)
i = 0
For Each Cell In plage
If Cell.Value = Monchiffre Then
UserForm10.ListBox1.ColumnCount = 6
UserForm10.ListBox1.ColumnWidths = "50pt;70pt;40pt;180pt;55pt;55pt"
UserForm10.ListBox1.AddItem
UserForm10.ListBox1.Column(0, i) = Cell.Address
UserForm10.ListBox1.Column(1, i) = Cell(1, -5)
UserForm10.ListBox1.Column(2, i) = Cell(1, -6)
UserForm10.ListBox1.Column(3, i) = Cell(1, -2)
UserForm10.ListBox1.Column(4, i) = 0
UserForm10.ListBox1.Column(5, i) = Cell.Value
i = i + 1
End If
Next Cell
For Each Cell In plage1
If Cell.Value = Monchiffre Then
UserForm10.ListBox1.ColumnWidths = "50;70;40;180;55;55"
UserForm10.ListBox1.AddItem
UserForm10.ListBox1.Column(0, i) = Cell.Address
UserForm10.ListBox1.Column(1, i) = Cell(1, -4)
UserForm10.ListBox1.Column(2, i) = Cell(1, -5)
UserForm10.ListBox1.Column(3, i) = Cell(1, -1)
UserForm10.ListBox1.Column(4, i) = Cell.Value
UserForm10.ListBox1.Column(5, i) = 0
i = i + 1
End If
Next Cell
End Sub |
Partager