ที่ procedure Private Sub TextBox1_Change()
ผมต้องการค้นหารายการสินค้าที่ textbox1 รายการสินค้าที่ต้องการให้เริ่มค้นหาอยู่ที่เซลล์ M15 ลงมา
แล้วนำรายการสินค้ามาแสดงที่ listbox1
สมมุติ พิมพ์คำว่า "ส้ม" ก็ให้นำรายการสินค้าที่มีคำว่า ส้ม มาแสดงที่ listbox1
ตอนนี้ติดปัญหาที่ พิมพ์ชื่อรายการสินค้าไปแล้ว listbox1 ไม่แสดงผล
ขอบคุณครับ
Code: Select all
Private Sub TextBox1_Change()
Dim i As Long
TextBox1.Text = StrConv(TextBox1.Text, vbProperCase)
ListBox1.Clear
For i = 15 To Application.WorksheetFunction.CountA(Sheet1.Range("M:M"))
M = Len(TextBox1.Text)
If Left(Sheet1.Cells(i, 13).Value, M) = Left(TextBox1.Text, M) Then
ListBox1.AddItem Sheet1.Cells(i, 13).Value
ListBox1.List(ListBox1.ListCount - 1, 13) = Sheet1.Cells(i, 13).Value
End If
Next i
End Sub
You do not have the required permissions to view the files attached to this post.