Line One
asked on
Excel - need to merge rows where certain fields have different data but are otherwise the same record
Let us say I have 3 rows that have information for the same person - person xxxx, three different phone numbers
xxxx 666-7777
xxxx 777-6666
xxxx 676-6767
Is there a technique/software to merge these rows so I end up with a single row
as follows:
xxxx 666-7777 777-6666 676-6767
As there are several thousand records I want to do this to, manual is not an option.
xxxx 666-7777
xxxx 777-6666
xxxx 676-6767
Is there a technique/software to merge these rows so I end up with a single row
as follows:
xxxx 666-7777 777-6666 676-6767
As there are several thousand records I want to do this to, manual is not an option.
ASKER
Thanks for the quick response.
XXXX would be a name e.g. John so what we have are three rows:
John 666-7777
John 777-6666
John 676-6767
and the end result desired is:
John 666-7777 777-6666 676-6767
XXXX would be a name e.g. John so what we have are three rows:
John 666-7777
John 777-6666
John 676-6767
and the end result desired is:
John 666-7777 777-6666 676-6767
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome. I am going to try it right now.
ASKER
Got debug error and yellow highlight on:
CurrentName = Left(CurrentName, InStr(CurrentName, " ") - 1)
CurrentName = Left(CurrentName, InStr(CurrentName, " ") - 1)
Then your data was not presented correctly.
Please give some examples of xxxx.
Real examples.
Kevin
Please give some examples of xxxx.
Real examples.
Kevin
The workbook you posted does not contain any data that looks like your data posted above.
Please clarify your objective.
Kevin
Please clarify your objective.
Kevin
ASKER
Rows 7, 8 and 9 are replaced by a single row like row 12 per the attached.
rows-to-be-condensed-example-spr.xlsx
rows-to-be-condensed-example-spr.xlsx
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. I will give this a shot.
ASKER
Awesomer! Sort of magical.
What I did was substitute:
Public Sub ConsolidateRowsDefault()
ConsolidateRows ActiveSheet.UsedRange, Array(2)
End Sub
for :
Public Sub ConsolidateRowsDefault()
ConsolidateRows ActiveSheet.UsedRange, Array(1)
End Sub
I then ran it. Everything concatenated as you said.
Only one small difference which doesn't seem to have anything to do with concatenation:
Column BZ originally had:
"""Dsilva (dsilva@vertucis.com)"" <Dsilva (dsilva@vertucis.com>
""Dsilva (Dsilva@yetmoremail.com)"" <Dsilva@yetmoremail.com>
"
but the condensed/concatenated result version Column BZ had:
"""Dsilva (dsilva@vertucis.com)"" <Dsilva (dsilva@vertucis.com>
""Dsilva (Dsilva@yetmoremail.com)"" <Dsilva@yetmoremail.com>
"
Some type of formatting issue - it seems to have just been cut off.
What I did was substitute:
Public Sub ConsolidateRowsDefault()
ConsolidateRows ActiveSheet.UsedRange, Array(2)
End Sub
for :
Public Sub ConsolidateRowsDefault()
ConsolidateRows ActiveSheet.UsedRange, Array(1)
End Sub
I then ran it. Everything concatenated as you said.
Only one small difference which doesn't seem to have anything to do with concatenation:
Column BZ originally had:
"""Dsilva (dsilva@vertucis.com)"" <Dsilva (dsilva@vertucis.com>
""Dsilva (Dsilva@yetmoremail.com)""
"
but the condensed/concatenated result version Column BZ had:
"""Dsilva (dsilva@vertucis.com)"" <Dsilva (dsilva@vertucis.com>
""Dsilva (Dsilva@yetmoremail.com)""
"
Some type of formatting issue - it seems to have just been cut off.
ASKER
Any comment on the problem?
I don't see any difference in the before and after strings for the "BZ" value. Is there a problem and, if so, what, exactly, is the problem?
Kevin
Kevin
ASKER
I will dig up the original - the cut-and-paste seems to have been the same - must not have changed the focus. Sorry. I will dig up the original files and provide the correct before and after.
ASKER
I can't seem to find the items - not a big issue, doesn't take away from the great solution provided. Thanks again.
Kevin