ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Does anyone know how I can concat duplicate cells associating info? (https://www.excelbanter.com/excel-programming/447952-re-does-anyone-know-how-i-can-concat-duplicate-cells-associating-info.html)

pai

Does anyone know how I can concat duplicate cells associating info?
 
On Tuesday, June 24, 2003 12:34:05 AM UTC+5:30, Tom Ogilvy wrote:
Sub Tester3()
Dim lastrow As Long
Dim i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
i = lastrow
Do While i 1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i - 1, 2).Value = Cells(i - 1, 2).Value & "; " & _
Cells(i, 2).Value
Cells(i, 1).EntireRow.Delete
End If
i = i - 1
Loop

End Sub

Worked for me with the data you show.

Regards,
Tom Ogilvy

"Amie Fleming" wrote in message
...
Tom,

Thanks for the reply. Sorry I wasn't specific enough...

Here is an example of my data:

ID | Data
--------------------------
1231 web
1242 email
1267 data1
2983 data2
3049 web
3049 email
7869 email
5930 data3
5930 web
5930 data1

The above is my spreadsheet (with a TON of data). I need to search for
ID's which are duplicates (3049 and 5930 in the example), and create
just one row (so that I end up with unique ID's for each row). I need
to concat the "Data" field's data...so my results would be as follows:

ID | Data
--------------------------
1231 web
1242 email
1267 data1
2983 data2
3049 web;email
7869 email
5930 data3;web;data1

If anyone has any tips I would greatly appriciate it!

Thanks!


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


What if don't want to Delete the Duplicate Rows?



isabelle

Does anyone know how I can concat duplicate cells associatinginfo?
 
hi,

if you want to color the duplicate rows:

change:
Cells(i, 1).EntireRow.Delete

by:
Cells(i, 1).EntireRow.Color.Index = 3

isabelle

Le 2013-01-07 23:31, pai a écrit :

What if don't want to Delete the Duplicate Rows?



isabelle

Does anyone know how I can concat duplicate cells associatinginfo?
 
correction:

Cells(i, 1).EntireRow.Interior.ColorIndex = 3

isabelle

Le 2013-01-08 00:18, isabelle a écrit :
hi,

if you want to color the duplicate rows:

change:
Cells(i, 1).EntireRow.Delete

by:
Cells(i, 1).EntireRow.Color.Index = 3

isabelle

Le 2013-01-07 23:31, pai a écrit :

What if don't want to Delete the Duplicate Rows?




All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com