Copying Defined Ranges

APPPRO

Active Member
Joined
Aug 6, 2002
Messages
256
I have a large series of Defined Column Ranges and I am trying to Copy some to another Workbook.

Set CopyRange = .Range("Job_Number, Job_Status, Job_Month, Job_Year, Job_Date, Assignment_Number, Inv_Number, Inv_Status, Inv_Month, Inv_Year, Due_Date, ShopsDB_Agent, Shop_Date, Location, Shop_Fee, Bonus_Fee, Billed_Hours, Billed_Food, Billed_Product, Billed_Additional, Billed_Total, Paid_Date, Paid_Fee, Paid_Bonus, Paid_Hourly, Paid_food, Paid_Product, Paid_Additional, Paid_Total, BTF")

This gives me an error message of defined variable at the 'Due_Date' Range. BUT when I simply break it down into to 2 CopyRanges - as below - it works great.


Set CopyRange = .Range("Job_Number, Job_Status, Job_Month, Job_Year, Job_Date, Assignment_Number, Inv_Number, Inv_Status, Inv_Month, Inv_Year")
Set CopyRange2 = .Range("Due_Date, ShopsDB_Agent, Shop_Date, Location, Shop_Fee, Bonus_Fee, Billed_Hours, Billed_Food, Billed_Product, Billed_Additional, Billed_Total, Paid_Date, Paid_Fee, Paid_Bonus, Paid_Hourly, Paid_food, Paid_Product, Paid_Additional, Paid_Total, BTF")


Why does this happen???

andy
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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