تم حل المشكلة
شكرا للجميع الحل كان في هذا الكود
Private Sub UserForm_Initialize()
With Me.ListBox1
.ColumnCount = 14
.RowSource = Empty
Sheets("PURCHASES").Select
.List = Range(Cells(1, 1), Cells(1, .ColumnCount)).Value
.ColumnWidths = "100,100,100,150,100,100,100,100,150,100,100,100,100,100"
End With
End Sub
ممكن ينفع حد وقع في نفس المشكلة وشكرا
تم الحل بهذا الكود في زر البحث
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Me.ListBox1.ColumnWidths = "100,100,100"
ListBox1.RowSource = Empty
ListBox1.Clear
Sheets("suppliers").Select
For Each f In Range("a2:a" & Range("a10000").End(xlUp).Row)
If f Like textbo1 & "*" Then
listed = ListBox1.ListCount
ListBox1.AddItem
ListBox1.List(listed, 0) = f
ListBox1.List(listed, 2) = f.Offset(0, 2)
ListBox1.List(listed, 3) = f.Offset(0, 3)
End If
Next
Dim x As Double
For i = 0 To ListBox1.ListCount - 1
x = x + ListBox1.List(i, 3)
Next i
Me.Label9.Visible = True
Me.TextBox8.Visible = True
TextBox8.Value = x
Dim v As Double
For Z = 0 To ListBox1.ListCount - 1
v = v + ListBox1.List(Z, 2)
Next Z
Me.Label8.Visible = True
Me.TextBox7.Visible = True
TextBox7.Value = v
Application.ScreenUpdating = True
End Sub
شكرا للجميع والله الموفق لي واياكم واذا لم استفيد بمساعدة احد يكفيني ان ممكن احد يستفيد من هذا الكود
شكرا