Subject: Macro Copy&Paste data (Value) based on multiple values

ebeyert

Active Member
Joined
Sep 15, 2006
Messages
281
Excel 2007/2010
I have the sheet ”Activity” where I record all the activities and the owners for each activity
Sheet: Activity

ABCDEFG
9IDWBSActivityStart dateFinish dateOwnerNotes
10ID1Action 1Jan, Paul, Henry
11ID2Action 2Kevin, Paul
12ID3Action 3Eric
13ID4Action 4Tom, Jeanne
14ID5Action 5Jan, Tom
15ID6Action 6
16ID7Action 7

<tbody>
</tbody>



I have also the sheet WorkPackage which have the same layout as the above sheet.
Sheet: WorkPackage

ABCDEFG
3Owner
4Jan, Paul
5
6
7
8
9IDWBSActivityStart dateFinish dateOwnerNotes
10Action 1Jan, Paul
11Action 2Kevin, Paul
12Action 5Jan, Tom
13

<tbody>
</tbody>





















What I want:
Based on the input (sheet “WorkPackage” cell C4) where I can put in the owner or owners all the activities of these owners needs to be copied from Sheet “Activity” to sheet “WorkPackage”

I am start with

Code:
Sub Copy_Data()  Range("A10:G999").Select
  Selection.Copy
  Sheets("WorkPackage").Select
  Range("A10:G999").Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub


But this is just copy&paste and I have no idea how I can do this based on the owner selection in cell C4

I hope that someone can help me
Thanks in advantage
Ellerd
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Watch MrExcel Video

Forum statistics

Threads
1,122,721
Messages
5,597,752
Members
414,171
Latest member
12Rev79

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
Top