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
| Option Explicit
Dim i As Long, c As Range
Private Sub TB1_Change()
Me.LB1.Clear
i = 0
For Each c In Application.Index([CODREF], , 1)
If UCase(c) Like UCase(Me.TB1) & "*" Then
Me.LB1.AddItem
Me.LB1.List(i, 0) = c.Value
Me.LB1.List(i, 1) = c.Offset(, 1).Value
i = i + 1
End If
Next c
End Sub
Private Sub LB1_Click()
If ActiveSheet.Name = "LIVRAISON" Then
ActiveCell = Me.LB1
ActiveCell.Offset(, 2) = Me.LB1.Column(1)
Unload Me
Else
ActiveCell = Me.LB1
ActiveCell.Offset(, 1) = Me.LB1.Column(1)
Unload Me
End If
End Sub
Private Sub UserForm_Initialize()
Me.LB1.List = [CODREF].Value
End S |
Partager