VBA Copying Data From Open Workbook

tigerfan81

New Member
Joined
Apr 3, 2011
Messages
3
I have one file that will always be open (master.xls). I will be opening various files and copying the same data range from master.xls to the current open workbook to the same location. Everything seems to be working, except after I copy the range from master.xls. I need some help with the code to activate the open sheet to paste it to because the files names vary that I am pasting to.

There will always be just the 2 files open. I am running Excel 2007 with Windows 7.

Thanks in advance and what a great forum....
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Which workbook contains the code? If you are opening master.xls from the current workbook, set an object variable to ActiveSheet before doing so. Then you can use that object variable when you want to paste to that sheet.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,287
Members
452,902
Latest member
Knuddeluff

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