Code
Set ws1 = Sheet4
rrow = ws1.Cells(Rows.Count, 1).End(xlUp).row
ary1 = ws1.Range("A2:o" & rrow).Value2
rctr = 1
For j = 1 To UBound(ary1)
If ary1(j, 1) = UserForm7.TextBox1.Value Then
rctr = rctr + 1
End If
Next j
ReDim ary2(1 To rctr, 1 To 15)
ctr = 1
For j = 1 To UBound(ary1)
If ary1(j, 1) = UserForm7.TextBox1.Value Then
ary2(ctr, 1) = ary1(j, 1)
ary2(ctr, 2) = ary1(j, 2)
ary2(ctr, 3) = ary1(j, 3)
ary2(ctr, 4) = ary1(j, 4)
ary2(ctr, 5) = ary1(j, 5)
ary2(ctr, 6) = ary1(j, 6)
ary2(ctr, 7) = ary1(j, 7)
ary2(ctr, 8) = ary1(j, 8)
ary2(ctr, 9) = ary1(j, 9)
ary2(ctr, 10) = ary1(j, 10)
ary2(ctr, 11) = ary1(j, 11)
ary2(ctr, 12) = ary1(j, 12)
ary2(ctr, 13) = ary1(j, 13)
ary2(ctr, 14) = ary1(j, 14)
ary2(ctr, 15) = ary1(j, 15)
ctr = ctr + 1
End If
Next j
With UserForm7.ListBox2
.ColumnCount = 15
.ColumnWidths = "120,150,90,95,90,45,45,45,45,45,45,45,120,95,90"
.List = ary2
For lx = 0 To ctr - 2
.Column(13, lx) = Format(.Column(13, lx), ("0%"))
.Column(2, lx) = Format(.Column(2, lx), ("dd-mm-yyyy"))
.Column(3, lx) = Format(.Column(3, lx), ("dd-mm-yyyy"))
Next lx
End With
Display More
Please check the code Rowsource property is not set - If i set means it shows "couldn't set rowsource property. please give suggestion