VBA Range Copy: Skip Middle Columns and Include End Columns in Copy?

olimits7

Board Regular
Joined
Oct 29, 2004
Messages
229
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a worksheet with 20 columns, the below code copies my data in the first 10 columns. However, I would like to skip columns 11-15 but include columns 16-20 in my range copy; what would be the best way to do this?

Code:
With Workbooks(rFile).Worksheets("Master List").Range("A1")
        Run rFile & "!replist"
        Range(.Offset(0, 0), .Offset(0, 10).End(xlDown)).Copy
    End With
    
    With ThisWorkbook.Worksheets("REV")
        .Range("A1").PasteSpecial xlPasteAll
        Application.CutCopyMode = False
    End With

Thank you!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
maybe something like this after the code you posted

Code:
With  Workbooks(rFile).Worksheets("Master List").Range("A1")
        Run rfile & "!replist"
        Range(.Offset(0, 15), .Offset(0, 19).End(xlDown)).Copy
    End With
    
    With ThisWorkbook.Worksheets("REV")
        .Range("P1").PasteSpecial xlPasteAll
        Application.CutCopyMode = False
    End With
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top