Copy Paste R1C1 help

puck

New Member
Joined
Aug 24, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a little amount of data that changes constantly that I need to move from one file and past amongst 8 different tables. I'm new to working with vba on excel, but trying to learn. Any assistance would be appreciated.

VBA Code:
    Workbooks("Phone import prep book.xlsm").Worksheets("Dataset").Range("A3:a102").Copy
    Workbooks("import_test.xlsx").Worksheets("Basic").Range("C11:C110").PasteSpecial xlPasteValues
    Workbooks("import_test.xlsx").Worksheets("Handle").Range("B11:B110").PasteSpecial xlPasteValues
    Workbooks("import_test.xlsx").Worksheets("CM Endpoit Profile").Range("AI11:AI110").FormulaR1C1("R[35]C[11]:R[35]C[110]").PasteSpecial xlPasteValues

I keep getting a script out of range.

Thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
With regards to your error "Script out of range", it could mean that the workbook you've specified is not opened. Or, it could mean that the worksheet you've specified does not exist within the specified workbook. Or it could mean that either the workbook name or worksheet name is spelled incorrectly, and so it can't find either of them.

By the way, I'm not sure why you're using FormulaR1C1 on your last line, but it looks like it should be...

VBA Code:
Workbooks("import_test.xlsx").Worksheets("CM Endpoit Profile").Range("AI11:AI110").PasteSpecial xlPasteValues

Hope this helps!
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,222
Messages
6,123,704
Members
449,118
Latest member
MichealRed

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