title: Pulling specific records based on value in another cell
body: <p>I am reaching out again since I got great help last time.  I have a worksheet that I import daily.  I would like it to loop through the names in col B and paste the records for that employee in another sheet and to name that sheet the employee's name (ie John Doe).  I would like to have each employee listed on their own named sheet with only those records associated with their name.  I will generate a report for each employee from their sheet.</p>
  <p>Here is the code I got so far:</p>
  <pre><code> Sub GetEmployeeLines()
      Const STARTING_ROW As Long = 2
      Dim c As Long: c = STARTING_ROW
      Dim lr As Long
      
      Application.ScreenUpdating = False
      Application.Calculation = xlCalculationManual
  
  
      lr = ActiveSheet.Range(&quot;B2:B1000&quot;).End(xlUp).Row
      
      Dim cell As Range
      For Each cell In Sheets(&quot;RawData&quot;).Range(&quot;B2:B&quot; &amp; lr).Cells
          If cell &lt;&gt; &quot;&quot; Then
              Sheets(&quot;DiscrepencyForm&quot;).Range(&quot;C:F&quot;).Rows(c).Value = cell.EntireRow.Columns(3).Resize(, 4).Value
              c = c + 1
          End If
      Next
     
      Application.ScreenUpdating = True
      Application.Calculation = xlCalculationAutomatic
      
      End Sub
  </code></pre>
  <p>I have also attached a screenshot of my dataset.</p>
  <p><a href="https://i.stack.imgur.com/ApFsb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ApFsb.png" alt="Sample Datasheet" /></a></p>