I am trying to find a way to copy cell ranges 2 - 12 and 14 - 17 to another sheet. I can't seem to work out how to copy range 14 - 17 successfully.
The code below manages to copy range 2 - 12 and cell 14 only.
For i = 1 To Cells(Rows.Count, "G").End(xlUp).Row If Surname = vbNullString And fName = vbNullString Then Exit Sub ElseIf InStr(Cells(i, 6).Value, Surname) > 0 And InStr(Cells(i, 8).Value, fName) > 0 Then Union(Range(Cells(i, 2), Cells(i, 12)), Cells(i, 14)).Copy wsTarget.Range("B" & wsTarget.Cells(Rows.Count, "B").End(xlUp).Row + 1).PasteSpecial (xlPasteValues) Range("G" & i).EntireRow.Delete Shift:=xlUp End If Next i
Any assistance would be greatly appreciated.