ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   what is the code cann make this pls. help me (https://www.excelbanter.com/excel-programming/440919-what-code-cann-make-pls-help-me.html)

abu [email protected]

what is the code cann make this pls. help me
 
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

abu [email protected]

what is the code cann make this pls. help me
 
On Mar 23, 3:31*pm, "abu "
wrote:
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


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com