copy data to 2 main sheets depending on cell value in the rest of the sheets

caseyc

New Member
Joined
Aug 5, 2015
Messages
4
I hope you can help me because i am new to vba and it gets a bit hard to do it. So, i have 2 main sheets ( kids and parents) and another 3 sheets that i use for data input. What i want the code to do is to copy the values of the 3 sheets from column A TO L and transfer them to the main sheets depending on the value chosen in column D in the other sheets. So if i insert data to one of the 3 sheets and i have as a value in column D "kids" it should transfer it to SHEET "KIDS" or if i choose value "parents" the data should go to sheet "parents". In any case, i do want it to remove duplicates and not copy the same data each time i open the file. Hope this is clear and if you could help me with this it would be life saving. Thank you so much!

Casey
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
First of all thank you for your time sir. Identical data cannot appear because in each sheet column A is to insert a unique name. So even if the other columns are identical (from B TO L) the A column will always be different from sheet to sheet.Here's a small example:

[TABLE="width: 619"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD="colspan: 3"](Sheet3) Ben[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Sheet 2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]NAME[/TD]
[TD]ISSUE[/TD]
[TD]COMMUNICATION APPROACH[/TD]
[TD]SEND TO[/TD]
[TD]BEST ACTION[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]BEN[/TD]
[TD]OK[/TD]
[TD]OK
[/TD]
[TD]KIDS[/TD]
[TD]TRB[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]BEN[/TD]
[TD]H/A[/TD]
[TD]N/A[/TD]
[TD]PARENTS[/TD]
[TD]EWD[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[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]H/A[/TD]
[TD]N/A[/TD]
[TD]KIDS[/TD]
[TD]EWD[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 3"](Main sheet2) parents[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]NAME[/TD]
[TD]ISSUE[/TD]
[TD]COMMUNICATION APPROACH[/TD]
[TD]SEND TO[/TD]
[TD]BEST ACTION[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]LINDA[/TD]
[TD]OK[/TD]
[TD]N/A[/TD]
[TD]PARENTS[/TD]
[TD]TRC[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]BEN[/TD]
[TD]H/A[/TD]
[TD]N/A[/TD]
[TD]PARENTS[/TD]
[TD]EWD[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
main sheet 2

[TABLE="class: cms_table, width: 619"]
<tbody>[TR]
[TD]2[/TD]
[TD]LINDA[/TD]
[TD]OK[/TD]
[TD]N/A[/TD]
[TD]PARENTS[/TD]
[TD]TRC[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]BEN[/TD]
[TD]H/A[/TD]
[TD]N/A[/TD]
[TD]PARENTS[/TD]
[TD]EWD

how were these 2 rows selected
kids and parents seem to have the same names ?[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
These rows would be selected because of their value in column D which is "parents"...does that help?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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