سلام دوستان و استادان گرامی
یک جدول سرچ ، فقط هنگام سرچ جدول بهم میریزه لطفا کمک کنید ممنونم.
یک جدول سرچ ، فقط هنگام سرچ جدول بهم میریزه لطفا کمک کنید ممنونم.
Private Sub TextBox1_Change() Dim j ListBox1.Clear Dim c As Range For Each c In Sheet4.Range("a3", Sheet4.Range("a10000").End(xlUp).Address) If InStr(1, c.Text, TextBox1.Text, vbTextCompare) <> 0 Then If c.Text <> "" Then ListBox1.AddItem ListBox1.List(ListBox1.ListCount - 1, 0) = c.Offset(0, 1).Value ListBox1.List(ListBox1.ListCount - 1, 1) = c.Value For j = 2 To 7 ListBox1.List(ListBox1.ListCount - 1, j) = c.Offset(0, j).Value Next j End If End If Next c Label3.Caption = ListBox1.ListCount End Sub
Private Sub TextBox1_Change() Dim j ListBox1.Clear ListBox1.ColumnCount = 18 ListBox1.TextAlign = fmTextAlignCenter Dim c As Range For Each c In Sheet5.Range("c3", Sheet5.Range("c10000").End(xlUp).Address) If InStr(1, c.Text, TextBox1.Text, vbTextCompare) <> 0 Then If c.Text <> "" Then ListBox1.AddItem ListBox1.List(ListBox1.ListCount - 1, 0) = c.Offset(0, -1).Value ListBox1.List(ListBox1.ListCount - 1, 1) = c.Offset(0, 0).Value ListBox1.List(ListBox1.ListCount - 1, 2) = c.Offset(0, 1).Value For j = 1 To 15 ListBox1.List(ListBox1.ListCount - 1, j + 2) = c.Offset(0, j + 1).Value Next j End If End If Next c Label3.Caption = ListBox1.ListCount End Sub
Private Sub TextBox1_Change() Dim j ListBox1.Clear ListBox1.ColumnCount = 18 ListBox1.TextAlign = fmTextAlignCenter Dim c As Range For Each c In Sheet5.Range("c3", Sheet5.Range("c10000").End(xlUp).Address) If InStr(1, c.Text, TextBox1.Text, vbTextCompare) <> 0 Then If c.Text <> "" Then ListBox1.AddItem ListBox1.List(ListBox1.ListCount - 1, 0) = c.Offset(0, -1).Value ListBox1.List(ListBox1.ListCount - 1, 1) = c.Offset(0, 0).Value ListBox1.List(ListBox1.ListCount - 1, 2) = c.Offset(0, 1).Value For j = 1 To 15 ListBox1.List(ListBox1.ListCount - 1, j + 2) = c.Offset(0, j + 1).Value Next j End If End If Next c Label3.Caption = ListBox1.ListCount End Sub
کامنت