Home » excel » excel – Copy only selected range of the row

excel – Copy only selected range of the row

Posted by: admin May 14, 2020 Leave a comment


I am trying to replace “EntireRow.Copy” to only copy the range of columns F:AB.

Currently my code: xRg(K).EntireRow.CopyDestination:=

Copies the whole row. How can I have it select only the desired range?

How to&Answers:

I do this with a delete function I have:

sht.Range(col1 & “:” & col2).delete

You could modify it to do this:


You’d obviously need to swap out A1:C1 with variables based on some criteria. But that will set a range of cells equal to another range


Assuming xRg is a range (please post more code)

Range(Cells(xRg(K).Row, "F"), Cells(xRg(K).Row, "AB")).Copy


Using the below you copy from row 1 to row 10 of columns F:AB

Option Explicit

Sub test()

    With ThisWorkbook.Worksheets("Sheet1")
        .Range(.Cells(1, "F"), .Cells(10, "AB")).Copy
    End With

End Sub