Copying Data to Workbook containing Macro Code

Wamhoi

New Member
Joined
Mar 4, 2011
Messages
48
I wish to copy selected data to the workbook that contains the original Coding. So, for example, Workbook 1 contains a macro that manipulates the data in Workbook2, then I want to copy the data back to WorkBook1. Here is my failed attempt. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
'Copying Data from Workbook2 <o:p></o:p>
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
'Pasting Data to Workbook 1 that contains code. <o:p></o:p>

ThisWorkbook.Sheets("Data").Range ("A1") 'where the code is failing
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste<o:p></o:p>

<o:p></o:p>
Note: Workbook1's file name is constantly changing so I don't want to reference "Workbook1" directly but rather the workbook running the code. <o:p></o:p>
<o:p></o:p>
I hope it’s not confusing. <o:p></o:p>
<o:p></o:p>
Thanks, <o:p></o:p>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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