RE
voici mon code
Dim Sh As Object
Private Sub TextBox4_Change()
End Sub
Private Sub UserForm_Activate()
Set Sh = Feuil5
Call InitList(1, "")
End Sub
Sub InitList(Col, MaVar)
Derniereligne = Sh.Cells(Rows.Count, 1).End(xlUp).Row
With ListBox1
.Clear
.ColumnCount = 11
For X = 2 To Derniereligne
If UCase(Sh.Cells(X, Col)) Like UCase(MaVar) & "*" Then
.AddItem Sh.Cells(X, 1)
For C = 1 To 9
.List(.ListCount - 1, C) = Sh.Cells(X, C + 1).Text
Next C
End If
Next X
End With
End Sub
Private Sub TextBox1_Change()
Call InitList(3, TextBox1.Value)
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim i As Integer
Dim chemin As String
If ListBox1.ListIndex <= 0 Then Exit Sub
chemin = "\\192.168.1.251\Sassi sghaier\sassi\FACTURATION\2018\FACTURES"
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
RefFacture = ListBox1.List(i, 1)
ThisWorkbook.FollowHyperlink chemin & "\" & RefFacture & ".pdf"
Exit Sub
End If
Next i
End Sub
Private Sub UserForm_Initialize()
For m = 0 To Me.ListBox1.ListCount - 1
Sum = Sum + Val(ListBox1.List(m, 11))
Next m
Me.TextBox4 = Sum
Me.TextBox2.Value = Feuil3.Range("j4").Value
Me.TextBox3.Value = Feuil3.Range("j3").Value
End Sub