Find a text string and return data from same row with VBA
<p>I am building a macro code that is going to find a text string from a certain cell within a range of cells in a worksheet, and return data from the same row and print out all the matched row in another work sheet. I was using an array formula to do that in cell, but it turned out to be very slow and of bad architecture.</p>

<p>Let's say, I wanna find A2 from sheet2 in sheet1 within the range of E2:F20, and print out data from A to D from the same row in sheet3. </p>

<p>Now based on gary's student's answer, I came up with something like this,however, it still doesn't work. </p>

<pre><code>Sub Macro1()


Dim r1 As Range, r2 As Range, r3 As Range
Dim rw1 As Long

Set r2 = Sheets("Committees").Range("A2")
Set r1 = Sheets("Database").Range("P2:CO5000")
Set r3 = Sheets("Reports").Range("F2")

Set rw1 = r1.Find(What:=r2.Value, After:=r1(1)).Row
If Not rw1 Is Nothing Then
   Do Until rw1 Is Nothing
      Sheets("Database").Range("A" &amp; rw1 &amp; ":O" &amp; rw1).Copy r3
      Set rw1 = .FindNext(rw1)
   Loop
End If
Set rw1 = Nothing
Next
End Sub
</code></pre>

<p>How should I do this? Thanks in advance.</p>