قم باذالة الشرط
Private Sub CommandButton1_Click()
Dim m As Long
Dim s As Long
m = Sheet1.Range("a" & Rows.Count).End(xlUp).Row
For s = 2 To m
If Sheet1.Cells(s, 19).Value < Sheet1.Range("x1").Value Then
ListBox1.AddItem Sheet1.Cells(s, 1).Value
ListBox1.list(ListBox1.ListCount - 1, 1) = Sheet1.Cells(s, 5).Value
End If
Next s
End Sub
ليصبح هكذا
Private Sub CommandButton1_Click()
Dim m As Long
Dim s As Long
m = Sheet1.Range("a" & Rows.Count).End(xlUp).Row
For s = 2 To m
ListBox1.AddItem Sheet1.Cells(s, 1).Value
ListBox1.list(ListBox1.ListCount - 1, 1) = Sheet1.Cells(s, 5).Value
Next s
End Sub
قم بازالة الشرط if
تعديل بسيط.xlsm