title: If row contains specified value then copy ID to first column
body: <p>If a row contains the value "car" I am trying to copy the contents of the ID cell to A1.</p>
  
  <p>For example, if row D12 contains "car" I want to copy the contents of cell B12 to A12.</p>
  
  <p>Currently this is my code:</p>
  
  <pre><code>Dim lastRow As Long
  Dim cell As Range
  
  lastRow = Range("A" &amp; Rows.Count).End(xlUp).Row + 1
  
  For Each cell In Range("D2:D" &amp; lastRow)
  If InStr(1, cell.Value, "CAR") &lt;&gt; 0 Then
              cell.Offset(0, -3).Value = "test"
      End If
  Next
  </code></pre>
  
  <p>So currently the code find's the rows that has "car" but populates the cell with the value "test". I am struggling with how to reference/copy the cell over.</p>
  
  <p>This is because the first column of my worksheet requires a concatenation of values as the ID and I do not want to apply it to this string.</p>
  
  <p>Thanks for any advice/help!</p>