Dim book1 As Range Dim x, y, lookinrow As String Dim nrow As Integer x = TextBox1.Text nrow = 1 Range("A1").Select Do While ActiveCell.Value <> x nrow = nrow + 1 ActiveCell.Offset(1, 0).Select Loop Range("A" & nrow).Select If ActiveCell.Value = x Then Range("B" & nrow).Select y = ActiveCell.Value ListBox1.ColumnCount = 1 ListBox1.AddItem Range("B" & nrow).Value End Sub
Sorry if I have broken the rules. What I am trying to do is step trough all the cells in column A and find all the cell that contain the same thing as entered in textbox1. The above codes works in as far that it only finds the first match. Any ideas
This post has been edited by Atli: 29 March 2013 - 02:36 PM
Reason for edit:: Use [code] tags when posting code.