Address book linking

mistrellis

Board Regular
Joined
Mar 19, 2015
Messages
53
Need to be pointed in the right direction this is a seasonal question too:

My list contains single people and couples.
TitleSNameAdd1Add2Add3Add4LINK
MrBloggsNo1Fuff RoadFuff TownFuffingtonBLO001
MrsBloggsNo1Fuff RoadFuff TownFuffingtonBLO001
MissHousecoat13Flower LaneTooleyWooleyHOU001
DrHibbert56Town RoadTownshioTownlandHIB001
MrsHibbert56Town RoadTownshioTownlandHIB001

<tbody>
</tbody>

Is there an easy way to get ?

TitleSNameAdd1Add2Add3Add4LINK
Mr and MrsBloggsNo1Fuff RoadFuff TownFuffingtonBLO001
MissHousecoat13Flower LaneTooleyWooleyHOU001
Dr and MrsHibbert56Town RoadTownshioTownlandHIB001

<tbody>
</tbody>
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Not sure if you're comfortable with macros & vba script, but seems like an ultra quick way to fix a massive list.

This will read all of the activesheet into an array, create a Dictionary Object based off of the LINK id, replace the "Title" with the consolidated title, and remove duplicate "LINK" ids.

Code:
Sub Consolidate()
Dim rng As Range
Dim rARR As Variant
Dim dTitle As Object    'Dictionary
Dim i&


Set dTitle = CreateObject("Scripting.Dictionary")
Set rng = [A1].CurrentRegion
rARR = rng      'array houses all table data (incl headers)


'Dictionary Key based off of LINK column number (7)


'skip 1st row of array (Title Row)
For i = LBound(rARR, 1) + 1 To UBound(rARR, 1)
    If dTitle.exists(rARR(i, 7)) Then
        dTitle(rARR(i, 7)) = dTitle(rARR(i, 7)) & "|" & Trim(rARR(i, 1))
    Else
        dTitle.Add Key:=rARR(i, 7), Item:=Trim(rARR(i, 1))
    End If
Next i


're-loop through array to replace Title w/ new title
For i = LBound(rARR, 1) + 1 To UBound(rARR, 1)
    rARR(i, 1) = Replace(dTitle(rARR(i, 7)), "|", " & ")
Next i


'send range back to worksheet
rng = rARR


rng.RemoveDuplicates 7, 1
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,393
Messages
6,119,261
Members
448,880
Latest member
aveternik

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