Comparing two files and copy a range of cells

h4ndinet02

New Member
Joined
Jul 25, 2011
Messages
1
Hi all,

I'm a newbee here. so please be nice to me. =)

Okay, i have a situation here.

I want to compare 2 files, and then copy a range of cells and paste them into other sheets.
To be more clear here is the explanation:

i have 2 files (Master File & Working File).

=====Master file=====
L M N 0 --> COLOUMN
1.441
2.
3.FLEXI
4.
5. $84.95 BLANK BLANK BLANK
6. $84.95 BLANK BLANK BLANK
7. $84.95 BLANK BLANK BLANK
8. $228.88 BLANK BLANK BLANK
9. $254.85 BLANK BLANK BLANK
(1 to 9 are rows)

=====Working file========
A B C D E --> COLOUMN
1. $169.90 1/6/2011 441 FLEXI
2. $84.95 2/6/2011 441 FLEXI
3. $84.95 3/6/2011 441 FLEXI
4. $84.95 6/6/2011 441 FLEXI
5. $228.88 7/6/2011 441 FLEXI
(1 to 5 are rows)

=====Master file (after macro)========
L M N 0 --> COLOUMN
1.441
2.
3.FLEXI
4.
5. $84.95 $84.95 2/6/2011 BLANK
6. $84.95 $84.95 3/6/2011 BLANK
7. $84.95 $84.95 6/6/2011 BLANK
8. $228.88 $228.88 7/6/2011 BLANK
9. $254.85 BLANK BLANK BLANK
(1 to 9 are rows)
(in coloumn O, there would be a formula, but the macro dont need to create a formula for it)

======Working file (after macro)=======
A B C D E --> COLOUMN
1. $169.90 1/6/2011 441 FLEXI O
2. $84.95 2/6/2011 441 FLEXI O
3. $84.95 3/6/2011 441 FLEXI O
4. $84.95 6/6/2011 441 FLEXI O
5. $228.88 7/6/2011 441 FLEXI O
(1 to 5 are rows)
(In coloumn E, the macro will enter letter "O", if it match).

so the logic that i have found is, macro will start from Master file, cell L5 ($84.95), it will find the matching cell in Working file coloumn A.
if they match, macro will copy cells A&B from Working file with the row related to each cell that match with Master file.
Then after they copy the cells, macro will enter letter "O" to cell E in Working File.

i have tried my self, but it only keep taking row 2 in working file if the macro trying to find $84.95.
If you all want to see my macro, please let me know.
I'm a little bit embarassed to post it, coz it's so messy. since i'm not good in Macro/VBA language. =(

Could you all please help me to build the macro for this?
I really appreciate your help.

Thanks and regards,
Handi
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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