View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pixel Pixel is offline
external usenet poster
 
Posts: 2
Default Yet another Listbox question...

Hi All
I have been trying to modify my code below so that each time
the value in Textbox1 is found, instead of sending the the data found
in columns (A,B,C,D) of that row to 4 different Textboxes and having
to press ok in the msgbox to find the next matching value, I would
like to send the entire row of 4 columns of every match to a listbox
as it cycles through the columnA looking for matches..

I have found several pieces of code in this news group that would help
but not being a very good at programming have failed to integrate them
with any success. Although I have been able to generate several
different error messages) :)


Private Sub CommandButton1_Click()
i = 2

Do While Cells(i, 1).Value < ""


If TextBox1.Value = Cells(i,1).Value Then

TextBox2.Value = Cells(i, 1).Value 'columnA
TextBox3.Value = Cells(i, 2).Value 'columnB
TextBox4.Value = Cells(i, 3).Value 'columnC
TextBox5.Value = Cells(i, 4).Value 'columnD

MsgBox "Next Record"

End If

i = i + 1
Loop


End Sub



Any help would be appreciated

Pixel