Hello.
This is my second post about the same subject. Im sorry for double but it was not answered. Link to first post below.
https://www.mrexcel.com/forum/excel-questions/1045323-copy-if-match-offset-2.html
Ill try to explain it with an example this time.
What I need is:
1. "Check every 3rd cell from Sheets("fifth") column "A" against column "F" from Sheets("third")
(two sheets are being compared)
2. If value from "fifth" is found in "third" than copy cells DG and DI from "third" to N and M of Fifth
- Ofc the same row. If Sheets("fifth").Range("A30") is found in Sheets("third").Range("F822") than copy DG822 and DI822 from "third" to M30 and N30 of "fifth""
In this example
Sheets("FIFTH") A3 (654) was found in Sheets("THIRD") F5 and I need to copy from Sheets("THIRD") DG5 and DI5 to M3 and N3 Sheets("FIFTH")
the same with A6 (159) and so on till the last row.
SHEETS("THIRD")
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]DG[/TD]
[TD]DH[/TD]
[TD]DI[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]123[/TD]
[TD]WHITE[/TD]
[TD]data[/TD]
[TD]GREEN[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]456[/TD]
[TD]CAR[/TD]
[TD]data[/TD]
[TD]PLANE[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]789[/TD]
[TD]APPLE[/TD]
[TD]data[/TD]
[TD]BANANNA[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]987[/TD]
[TD]CAT[/TD]
[TD]data[/TD]
[TD]MOUSE[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]654[/TD]
[TD]FLY[/TD]
[TD]data[/TD]
[TD]DIG[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]321[/TD]
[TD]HOLE[/TD]
[TD]data[/TD]
[TD]SPACE[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]159[/TD]
[TD]TAR[/TD]
[TD]data[/TD]
[TD]DIRT[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]753[/TD]
[TD]BLEACH[/TD]
[TD]data[/TD]
[TD]CLEAN[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]852[/TD]
[TD]WALTZ[/TD]
[TD]data[/TD]
[TD]POLONEZ[/TD]
[/TR]
</tbody>[/TABLE]
SHEETS("FIFTH")
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1111[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2222[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]654[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD].......[/TD]
[TD].......[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3333[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4444[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]159[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD].......[/TD]
[TD].......[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5555[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6666[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
</tbody>[/TABLE]
I hope this will clear my goals.
Those sheets mayby big (50.000 +) so mayby dictionary or arrays would be better. (just thinking loudly)
Best Regards
W.
This is my second post about the same subject. Im sorry for double but it was not answered. Link to first post below.
https://www.mrexcel.com/forum/excel-questions/1045323-copy-if-match-offset-2.html
Ill try to explain it with an example this time.
What I need is:
1. "Check every 3rd cell from Sheets("fifth") column "A" against column "F" from Sheets("third")
(two sheets are being compared)
2. If value from "fifth" is found in "third" than copy cells DG and DI from "third" to N and M of Fifth
- Ofc the same row. If Sheets("fifth").Range("A30") is found in Sheets("third").Range("F822") than copy DG822 and DI822 from "third" to M30 and N30 of "fifth""
In this example
Sheets("FIFTH") A3 (654) was found in Sheets("THIRD") F5 and I need to copy from Sheets("THIRD") DG5 and DI5 to M3 and N3 Sheets("FIFTH")
the same with A6 (159) and so on till the last row.
SHEETS("THIRD")
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]DG[/TD]
[TD]DH[/TD]
[TD]DI[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]123[/TD]
[TD]WHITE[/TD]
[TD]data[/TD]
[TD]GREEN[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]456[/TD]
[TD]CAR[/TD]
[TD]data[/TD]
[TD]PLANE[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]789[/TD]
[TD]APPLE[/TD]
[TD]data[/TD]
[TD]BANANNA[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]987[/TD]
[TD]CAT[/TD]
[TD]data[/TD]
[TD]MOUSE[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]654[/TD]
[TD]FLY[/TD]
[TD]data[/TD]
[TD]DIG[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]321[/TD]
[TD]HOLE[/TD]
[TD]data[/TD]
[TD]SPACE[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]159[/TD]
[TD]TAR[/TD]
[TD]data[/TD]
[TD]DIRT[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]753[/TD]
[TD]BLEACH[/TD]
[TD]data[/TD]
[TD]CLEAN[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]852[/TD]
[TD]WALTZ[/TD]
[TD]data[/TD]
[TD]POLONEZ[/TD]
[/TR]
</tbody>[/TABLE]
SHEETS("FIFTH")
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1111[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2222[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]654[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD].......[/TD]
[TD].......[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3333[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4444[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]159[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD].......[/TD]
[TD].......[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5555[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6666[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[TD]data[/TD]
[/TR]
</tbody>[/TABLE]
I hope this will clear my goals.
Those sheets mayby big (50.000 +) so mayby dictionary or arrays would be better. (just thinking loudly)
Best Regards
W.
Last edited: