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
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Watch MrExcel Video

Forum statistics

Threads
1,122,561
Messages
5,596,845
Members
414,107
Latest member
Tigretto

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
Top