How can I copy data from one excel file to another excel file?

Brian Johnson_12

New Member
Joined
Sep 30, 2011
Messages
1
Hey guys,
So I am wondering, is it possible to copy data from one Excel file (either Excel version 2003 or 2007) to another Excel file of the same version?
I have data that is in once Excel file that is being updated often, about every 20 seconds, by way of a DDE link through RS Linx.
Since the data is being update by the link, I was wondering if there was a macro that could copy the data when a Boolean value changed.
For example:
If (part passed test) = True Then
copy cells A1-A6 to "C:\GPD_Oct_2011.xls" and [SpecificSheet(s)WithinthatWorkbook] 'GPD - good part data
Else
copy cells A1-A6 "C:\BPD_Oct_2011.xls" and [SpecificSheet(s)WithinthatWorkbook] ' BPD - bad part data
End If
In every instance I will need the data from one worksheet in one workbook to copy to another workbook where it will be needed to be copied to two different sheets maximum.
For example:
Part 1 is of part type ABC. Part 1 passes the testing and came off of tester 1.
That means the data for that part needs to be copied to the GPD_Oct_2011.xls file, to the ABC sheet and the tester 1 sheet. Both sheets are inside the GPD_Oct_2011.xls file.
Part 2 is of type XYZ. Part 2 does not pass testing and came off of tester 4.
That means the data for that part needs to be copied to the BPD_Oct_2011.xls file, to the XYZ sheet and the tester 4 sheet. Both sheets are inside the BPD_Oct_2011.xls file.
I hope I gave you all enough information to adequately describe my problem.
Thanks for your help in advance!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

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