Remove dupe rows but capture values from one column

HeatherF

New Member
Joined
Mar 3, 2020
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have a spreadsheet of people who met one or more selected criteria (Col. A), with 1 row for each of their relatives in the database (the relative's data is in columns F through J).
So Becky (rows 2 & 3) met one criteria (CREW) and has 2 relatives, so she has two rows... data repeats in columns A through E, and is different in F through J.

Where we have a problem is when a person meets two or more selected criteria. See Laurence whose rows repeat for DORM and VOLUNTEER, or Silas whose rows repeat for DORM, CREW, and VOLUNTEER.

I would like write a macro that removes rows that have duplicate data in Columns B through J, but capture the text in column A and add it to the text in column A for the remaining row with original values. So instead of Silas having 9 rows (3 for DORM, 3 for CREW, 3 for VOLUNTEER), he will have 3 rows the each have DORM CREW VOLUNTEER in column A.

Below I put my raw data, and my desired results. Also, the macro I created to de-dupe based on col. B-J. Is it possible to add code to the macro that will do what I'm hoping?

Test Affinity Network RAW DATA.xlsm
ABCDEFGHIJ
1AffinityID#Name5-yr GivingJnt LTGRelation IdRelation NameRelation TypeRelation 5-yr GivingRelation Jnt LTG
2CREW10019703Becky825188010081779Spouse/PartnerJose1701880
3CREW10019703Becky825188010020555ParentEdward025
4DORM10025811Laurence447570156406626ParentRichard3841.7963486.54
5DORM10025811Laurence4475701510030236SiblingJuliet6501305
6VOLUNTEER10025811Laurence447570156406626ParentRichard3841.7963486.54
7VOLUNTEER10025811Laurence4475701510030996ParentRichard063486.54
8DORM10025875Elizabeth600132010035178SiblingMichael6001130
9CREW10025875Elizabeth600132010035178SiblingMichael6001130
10CREW10025905Holly8754129.976934329ParentRobert2080475.916228633.19
11CREW10025905Holly8754129.9710025740Spouse/PartnerKris8754129.97
12CREW10025905Holly8754129.9710018011SiblingHeather1350025895
13VOLUNTEER10025905Holly8754129.976934329ParentRobert2080475.916228633.19
14VOLUNTEER10025905Holly8754129.9710018011SiblingHeather1350025895
15VOLUNTEER10025905Holly8754129.9710025740Spouse/PartnerKris8754129.97
16DORM10025944Anne750141810026293ParentGeoff5002600
17DORM10025944Anne750141810037397SiblingMichael45.02200.02
18CREW10025944Anne750141810026293ParentGeoff5002600
19CREW10025944Anne750141810037397SiblingMichael45.02200.02
20DORM10025966Silas212.51710.1710072388ParentSally046275
21DORM10025966Silas212.51710.1710086914InlawLiana00
22DORM10025966Silas212.51710.1710020131SiblingKaimi275575
23CREW10025966Silas212.51710.1710072388ParentSally046275
24CREW10025966Silas212.51710.1710086914InlawLiana00
25CREW10025966Silas212.51710.1710020131SiblingKaimi275575
26VOLUNTEER10025966Silas212.51710.1710072388ParentSally046275
27VOLUNTEER10025966Silas212.51710.1710086914InlawLiana00
28VOLUNTEER10025966Silas212.51710.1710020131SiblingKaimi275575
existing


Test Affinity Network RAW DATA.xlsm
ABCDEFGHIJ
1AffinityID#Name5-yr GivingJnt LTGRelation IdRelation TypeRelation NameRelation 5-yr GivingRelation Jnt LTG
2CREW10019703Becky825188010081779Spouse/PartnerJose1701880
3CREW10019703Becky825188010020555ParentEdward025
4DORM VOLUNTEER10025811Laurence447570156406626ParentRichard3841.7963486.54
5DORM VOLUNTEER10025811Laurence4475701510030236SiblingJuliet6501305
6DORM CREW10025875Elizabeth600132010035178SiblingMichael6001130
7CREW VOLUNTEER10025905Holly8754129.976934329ParentRobert2080475.916228633.19
8CREW VOLUNTEER10025905Holly8754129.9710025740Spouse/PartnerKris8754129.97
9CREW VOLUNTEER10025905Holly8754129.9710018011SiblingHeather1350025895
10DORM CREW10025944Anne750141810026293ParentGeoff5002600
11DORM CREW10025944Anne750141810037397SiblingMichael45.02200.02
12DORM CREW VOLUNTEER10025966Silas212.51710.1710072388ParentSally046275
13DORM CREW VOLUNTEER10025966Silas212.51710.1710086914InlawLiana00
14DORM CREW VOLUNTEER10025966Silas212.51710.1710020131SiblingKaimi275575
result


VBA Code:
Sub Dedupe()
'
' Dedupe Macro
' remove rows with dupe values in B through J
'

'
    ActiveSheet.Range("$A$1:$AW$454").RemoveDuplicates Columns:=Array(2, 3, 4, 5, 6, 7 _
        , 8, 9, 10), Header:=xlYes
End Sub

Thank you so much as always!

Heather
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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