Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Copying data between duplicated rows
Hello, how can I copy data between rows duplicated in two lists, but
not the data which is actually duplicated? Phew, that's tough to summarize. I have two lists, and both have two columns: name and data. The names are mostly duplicate in both lists. I would like to copy the data field from the old list to the new list, matching it up with the proper names. I've tried Chip Pearson's COUNTIF tricks, AutoFilter and sorting, but I can't seem to find a solution. Any suggestions? Thanks!! |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Copying data between duplicated rows
The following little macro will do it for you. As written, this macro
assumes your new list is in Columns A:B with the names in A and the data in B. Also, your old list is in Columns E:F with names in E and data in F. Column C is the destination column and is blank. Come back if you need more. HTH Otto Sub OldToNew() Dim rOldNames As Range Dim rNewNames As Range Dim i As Range Set rNewNames = Range("A3", Range("A" & Rows.Count).End(xlUp)) Set rOldNames = Range("E3", Range("E" & Rows.Count).End(xlUp)) For Each i In rOldNames If Not rNewNames.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then rNewNames.Find(What:=i.Value, LookAt:=xlWhole).Offset(, 2).Value = _ i.Offset(, 1).Value End If Next i End Sub wrote in message ... Hello, how can I copy data between rows duplicated in two lists, but not the data which is actually duplicated? Phew, that's tough to summarize. I have two lists, and both have two columns: name and data. The names are mostly duplicate in both lists. I would like to copy the data field from the old list to the new list, matching it up with the proper names. I've tried Chip Pearson's COUNTIF tricks, AutoFilter and sorting, but I can't seem to find a solution. Any suggestions? Thanks!! |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Copying data between duplicated rows
On Apr 12, 5:56 pm, "Otto Moehrbach"
wrote: The following little macro will do it for you. As written, this macro assumes your new list is in Columns A:B with the names in A and the data in B. Also, your old list is in Columns E:F with names in E and data in F. Column C is the destination column and is blank. Come back if you need more. HTH Otto Sub OldToNew() Dim rOldNames As Range Dim rNewNames As Range Dim i As Range Set rNewNames = Range("A3", Range("A" & Rows.Count).End(xlUp)) Set rOldNames = Range("E3", Range("E" & Rows.Count).End(xlUp)) For Each i In rOldNames If Not rNewNames.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then rNewNames.Find(What:=i.Value, LookAt:=xlWhole).Offset(, 2).Value = _ i.Offset(, 1).Value End If Next i End wrote in message ... Hello, how can I copy data between rows duplicated in two lists, but not the data which is actually duplicated? Phew, that's tough to summarize. I have two lists, and both have two columns: name and data. The names are mostly duplicate in both lists. I would like to copy the data field from the old list to the new list, matching it up with the proper names. I've tried Chip Pearson's COUNTIF tricks, AutoFilter and sorting, but I can't seem to find a solution. Any suggestions? Thanks!! Thanks!! Using .Offset() was my last resort, but it seems simple enough. But when I started considering VLOOKUP, I knew I was in too deep. I will try this out, thanks again. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compare and consolidating duplicated rows | Excel Discussion (Misc queries) | |||
Deleting Rows with data duplicated in 2 columns | Excel Worksheet Functions | |||
Duplicated rows | Excel Discussion (Misc queries) | |||
Duplicated rows | Excel Discussion (Misc queries) | |||
Delete non duplicated rows | Excel Discussion (Misc queries) |