I am trying to copy a range from one sheet to another which is a result of a comparison loop. the loop first compares values in one of the cells of a row with something on the sheet and if its a match, it copies that entire range to another sheet. Here is my code:
Worksheets("Sheet1").Cells(1, 14).Value = Driver_sel
For k = 1 To Worksheets("Sheet1").Cells(Rows.Count, 2).End(xlUp).Row
If ((Cells(k, 2))) = Cells(1, 14) Then
Worksheets("Sheet1").Range(Cells(k, 1), Cells(k, 12)).Copy
ActiveSheet.Cells(2, 14).PasteSpecial Transpose:=True
End If
Next k