i write code for my problem, but it's not working.
my excel book
A B C D E F G H I J
40 IP Phone VPH-01 iphone 12 ip12 1 1 Not Working
41 IP Phone VPH-02 ipphone 12 op1s 1 1 Not Working
42 IP Phone VPH-03 ipphone 12 iphone1 1 1 Working
Worksheets("Stock").Unprotect password:="teks1234"
FinalRow1 = cells(Rows.Count, 1).End(xlUp).Row
Dim mdl2 As Collection
On Error Resume Next
Set mdl2 = New Collection
With ModelNum2
.clear
For Each cell In Range("b3:b" & cells(Rows.Count, 1).End(xlUp).Row)
If Mid(cell, 1, 4) = "VPH-" Or Sheets("Stock").Range("J" & FinalRow1).Value = "Working" Then
Err.clear
mdl2.Add cell.Value
If Err.Number = 0 Then .AddItem cell.Value
End If
Next cell
End With
ModelNum2.ListIndex = -1
When i run this code, my drop down list have 3 values instead of One
my drop down list must have only working items.
how can i fill the my data
Bookmarks