what is the code cann make this pls. help me

  • Thread starter abu abdullah........halsaeed85
  • Start date
A

abu abdullah........halsaeed85

i have form to search for data through text box change code efect on
listbox its working ok with this code
Private Sub TextBox1_Change()
On Error Resume Next
Dim KH_Range As Range
Dim M As String
Set KH_Range = Range("DATA")
M = TextBox1.Text
ListBox1.Clear
If M = "" Then GoTo 1
W = ListBox1.ListCount
With KH_Range
KH_1 = .Rows.Count
KH_2 = .Columns.Count
Set A = Range(.Cells(1,
1), .Cells(.Rows.Count, .Columns.Count)).FIND(M)
If Not A Is Nothing Then
F = A.Address
Do

ListBox1.AddItem
ListBox1.List(W, 0) = Sheet3.Cells(A.Row, 1).Value
ListBox1.List(W, 1) = Sheet3.Cells(A.Row, 2).Value
ListBox1.List(W, 2) = Sheet3.Cells(A.Row, 3).Value
ListBox1.List(W, 3) = Sheet3.Cells(A.Row, 4).Value
ListBox1.List(W, 4) = Sheet3.Cells(A.Row, 5).Value
ListBox1.List(W, 5) = Sheet3.Cells(A.Row, 6).Value

W = W + 1


Set A = Range(.Cells(1, 1), .Cells(KH_1, KH_2)).FindNext(A)
Loop While Not A Is Nothing And A.Address <> F
End If
End With
Set A = Nothing
1 End Sub

i want to hilight first row in list box contain data match textbox
text when change it
can any one help .
thanks advanced
 
A

abu abdullah........halsaeed85

i have form to search for data through text box change code efect on
listbox its working ok with this code
Private Sub TextBox1_Change()
On Error Resume Next
Dim KH_Range As Range
Dim M As String
Set KH_Range = Range("DATA")
M = TextBox1.Text
ListBox1.Clear
If M = "" Then GoTo 1
W = ListBox1.ListCount
   With KH_Range
      KH_1 = .Rows.Count
      KH_2 = .Columns.Count
         Set A = Range(.Cells(1,
1), .Cells(.Rows.Count, .Columns.Count)).FIND(M)
         If Not A Is Nothing Then
         F = A.Address
         Do

            ListBox1.AddItem
            ListBox1.List(W, 0) = Sheet3.Cells(A.Row, 1).Value
            ListBox1.List(W, 1) = Sheet3.Cells(A.Row, 2).Value
            ListBox1.List(W, 2) = Sheet3.Cells(A.Row, 3).Value
            ListBox1.List(W, 3) = Sheet3.Cells(A.Row, 4).Value
            ListBox1.List(W, 4) = Sheet3.Cells(A.Row, 5).Value
            ListBox1.List(W, 5) = Sheet3.Cells(A.Row, 6).Value

            W = W + 1

         Set A = Range(.Cells(1, 1), .Cells(KH_1, KH_2)).FindNext(A)
         Loop While Not A Is Nothing And A.Address <> F
         End If
  End With
Set A = Nothing
1 End Sub

i want to hilight first row in list box contain data match textbox
text when change it
can any one help .
thanks advanced

up
pls any help its urgent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top