MEMBUAT SEARCHING MULTI PENCARIAN DENGAN DI LISTBOX VBA

 


Untuk membuat muti pencarian,
cari berdasarkan kriteria yang di inginkan.



langsung aja Berkut Scriptnya :

Private Sub CMDSEARCH_Click()
ListBox1.Clear
Call headlist
Dim RowNum As Long
RowNum = 1
Do Until Sheet5.Cells(RowNum, 1).Value = ""

If InStr(1, Sheet5.Cells(RowNum, 14).Value, TCARIBIN.Value, vbTextCompare) > 0 Then
On erro GoTo next1
If InStr(1, Sheet5.Cells(RowNum, 6).Value, TCARIKODE.Value, vbTextCompare) > 0 Then
On erro GoTo next1
If InStr(1, Sheet5.Cells(RowNum, 7).Value, TCARINAMA.Value, vbTextCompare) > 0 Then
On erro GoTo next1
If InStr(1, Sheet5.Cells(RowNum, 4).Value, TCARITGL.Value, vbTextCompare) > 0 Then
On erro GoTo next1
If InStr(1, Sheet5.Cells(RowNum, 20).Value, TSTATUS.Value, vbTextCompare) > 0 Then
On erro GoTo next1
ListBox1.AddItem Sheet5.Cells(RowNum, 3).Value ' barcode
ListBox1.List(ListBox1.ListCount - 1, 1) = Sheet5.Cells(RowNum, 4).Value 'tgl
ListBox1.List(ListBox1.ListCount - 1, 2) = Sheet5.Cells(RowNum, 6).Value 'kode
ListBox1.List(ListBox1.ListCount - 1, 3) = Sheet5.Cells(RowNum, 7).Value 'nama mat
ListBox1.List(ListBox1.ListCount - 1, 4) = Sheet5.Cells(RowNum, 11).Value 'qty
ListBox1.List(ListBox1.ListCount - 1, 5) = Sheet5.Cells(RowNum, 14).Value 'bin
ListBox1.List(ListBox1.ListCount - 1, 6) = Sheet5.Cells(RowNum, 19).Value 'no order
ListBox1.List(ListBox1.ListCount - 1, 7) = Sheet5.Cells(RowNum, 20).Value 'status
End If
End If
End If
End If
End If
next1:
RowNum = RowNum + 1
Loop

End Sub




Post a Comment (0)
Previous Post Next Post