title: Excel VBA code needed to copy row if criteria is met
body: <p>I have an excel document with two sheets. Sheet 1 has columns A-Q and Sheet 2 has columns A-H. What I need is a code that will copy the information in a row from sheet 1 to sheet 2 if the criteria is met. The criteria is the word "Awarded" in column L (Sheet 1). 
  Also is it possible to have only specific columns in the row copied? </p>
  
  <pre><code>A    B    C    D    E    F    G    H    I   J   K   L      M   N
            X    X                                  Awarded  X   X
  </code></pre>
  
  <p>I would like to have only columns C,D,M, and N copied from the row if the word "awarded" is in column L. This information would be copied to Sheet 2 in the following fashion</p>
  
  <pre><code>Sheet 1       Sheet 2  
  D        --&gt;   B  
  C        --&gt;   C  
  M        --&gt;   D  
  N        --&gt;   F
  </code></pre>
  
  <p>I hope I'm being clear. Thanks in advance and let me know if I need to clarify!+</p>
  
  <p>This is the code I currently have, which works. Only problem is it copies the entire row of information into sheet 2 when I only want rows D,C,M, and N to be copied.</p>
  
  <pre><code>Sub testing()
  Set a = Sheets("Sheet1")
  Set b = Sheets("Sheet2")
  Dim d
  Dim j
  d = 1
  j = 2
  
  Do Until IsEmpty(a.Range("L" &amp; j))
  
  
  
   If a.Range("L" &amp; j) = "Awarded" Then
   d = d + 1
   b.Rows(d).Value = a.Rows(j).Value
  
   End If
   j = j + 1
  
  Loop
  End Sub
  </code></pre>