snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
'-----othercode
Me.ListBox1.ColumnCount = 8
Me.ListBox1.List = arr
ListBox1.ColumnWidths = "40,100,100,100,100,100,100"
For i = 3 To Sheet2.Range("A1000000").End(xlUp).Row
If Sheet2.Cells(i, 2).Value = Sheet1.Cells(4, 9).Value Or Sheet2.Cells(i, 4).Value = Sheet1.Cells(4, 9).Value Then
Me.ListBox1.AddItem
For x = 1 To 8
Me.ListBox1.List(ListBox1.ListCount - 1, x - 1) = Sheet2.Cells(i, x)
Next x
End If
Next i
'-----othercode
You do not have the required permissions to view the files attached to this post.
'-----othercode
Me.ListBox1.ColumnCount = 8
Me.ListBox1.List = arr
ListBox1.ColumnWidths = "40,100,100,100,100,100,100"
For i = 3 To Sheet2.Range("A1000000").End(xlUp).Row
If Sheet2.Cells(i, 2).Value Like "*" & Sheet1.Cells(4, 9).Value & "*" Or Sheet2.Cells(i, 4).Value Like "*" & Sheet1.Cells(4, 9).Value & "*" Then
Me.ListBox1.AddItem
For x = 1 To 8
Me.ListBox1.List(ListBox1.ListCount - 1, x - 1) = Sheet2.Cells(i, x)
Next x
End If
Next i
'-----othercode