PC Review


Reply
Thread Tools Rate Thread

what is the code cann make this pls. help me

 
 
abu abdullah........halsaeed85@gmail.com
Guest
Posts: n/a
 
      23rd Mar 2010
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
 
Reply With Quote
 
 
 
 
abu abdullah........halsaeed85@gmail.com
Guest
Posts: n/a
 
      24th Mar 2010
On Mar 23, 3:31*pm, "abu abdullah........halsaee...@gmail.com"
<halsaee...@gmail.com> 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
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can I use code to make code in another book Michelle Microsoft Excel Programming 3 27th May 2010 10:17 PM
Verify Canadian Postal Code ~ make the code work jat Microsoft Excel Programming 2 27th Feb 2009 09:12 PM
Linq to XML--Are there code examples that make Linq as easy as SQL? Or how can I convert ths simple pseudo code into real code? Reece Microsoft C# .NET 4 10th Dec 2008 03:13 AM
Sample code to make your code reload data that changed in config file delphiconsultingguy@yahoo.com Microsoft Dot NET Framework 0 13th Jun 2006 06:55 PM
How to make a button VBA code reference other VBA code subroutines??? gunman Microsoft Excel Programming 4 27th Sep 2005 01:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:15 PM.