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
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