title: Loop through sheet, look for specific value, paste row with matching value to another sheet
body: <p>People take a survey and their responses end up in one row in an Excel spreadsheet. People take multiple surveys, so their responses are spread throughout multiple worksheets. These people have IDs they use before every survey.</p>
  
  <p>I want to loop through rows in each worksheet and copy certain cells from the row with a particular person's survey responses. The assumption is the person pulling responses into one spreadsheet knows the ID.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub CreateSPSSFeed()
  
  Dim StudentID As String  ' (StudentID is a unique identifier)
  Dim Tool As Worksheet    ' (this is the worksheet I'm pulling data into)
  Dim Survey1 As Worksheet ' (this is the sheet I'm pulling data from)
  Dim i As Integer         ' (loop counter)
  
  Tool = ActiveWorkbook.Sheets("ToolSheet")
  Survey1 = ActiveWorkbook.Sheets("Survey1Sheet")
  
  ' (This is how the loop knows what to look for)
  StudentID = Worksheet("ToolSheet").Range("A2").Value 
  
  ActiveWorksheet("Survey1").Select ' (This loop start with the Survey1 sheet)
  For i = 1 to Rows.Count ' (Got an overflow error here)
      If Cells (i, 1).Value = StudentID Then
          '!Unsure what to do here-- need the rest of the row
          ' with the matching StudentID copied and pasted
          ' to a specific row in ToolSheet, let's say starting at G7!
      End If
  Next i
  
  End Sub
  </code></pre>
  
  <p>I researched here and haven't had a lot of luck combining loops with moving across sheets.</p>