title: Copy values in columns C and F in range1 to columns P and R in range2?
body: <p>I am having issues with the bolded line of code below: I get an error that states, "Application-defined or object-defined error"</p>
  
  <p>I sort of morphed this code from a previous code of mine...</p>
  
  <pre><code>Option Explicit
  
  Sub BringDownSNs()
  Call OptimizeCode_Begin
  
  Dim cell1 As Range, rng1 As Range, cell2 As Range, rng2 As Range
  Dim array1, array2, counter1 As Long, counter2 As Long
  Dim StartTime As Double
  Dim MinutesElapsed As String
  
  Set rng1 = Sheets("Sheet1").Range("B2:B" &amp; Sheets("Sheet1").Cells(Sheets("Sheet1").Rows.Count, "B").End(xlUp).row)
  Set rng2 = Sheets("Sheet1").Range("M2:M" &amp; Sheets("Sheet1").Cells(Sheets("Sheet1").Rows.Count, "M").End(xlUp).row)
  
  array1 = rng1.Offset(0, 4).Resize(, 5).Value 'creating an array by taking rng1 (column B) and offsetting it by 4 (to include up to column F), then resizing to include columns B through F (5 columns total)
  array2 = rng2.Offset(0, 5).Resize(, 6).Value 'same as above but using rng2
  
  For counter2 = 1 To UBound(array2) 'for each row in array2 - from row 1 in array 2 to upper bound of array 2 (row 3865)
      For counter1 = 1 To UBound(array1) 'for each row in array1 - from row 1 in array 1 to upper bound of array 1 (row 2390)
  
      'if array 2 -&gt; sheet 1, current row (starting with row 1 of the array), column 1 of the array (Column M, NHA Part Number) equals array 1 -&gt; sheet 1, current row, column 1 of the array (Column B, NHA Part Number) _
       AND if array 2 -&gt; sheet 1, current row, column 5 of the array (Column Q , Part Number) equals array 1 -&gt; sheet 1, current row, column 4 of the array (Column E, Part Number) THEN _
       copy data from current row in array 1 (columns C &amp; F) into current row in array 2 (columns P &amp; R)
  
          If array2(counter2, 1) = array1(counter1, 1) And array2(counter2, 5) = array1(counter1, 4) Then
              **Sheets("Sheet1").Range("C:C" &amp; counter1 + 1 &amp; "F:F" &amp; counter1 + 1).Copy Destination:=Sheets("Sheet1").Range("P:P" &amp; counter2 + 1 &amp; "R:R" &amp; counter2 + 1)**
          Exit For
          End If
      Next
  Next
  
  Call OptimizeCode_End
  End Sub
  </code></pre>