Moving data and deleting duplicate row

jcollinsjr

New Member
Joined
Aug 27, 2011
Messages
2
Hello All,

I hope someone can help me. I've been searching for a week looking for a formula or macro that will do the following....

Help.jpg


I want to delete the duplicate Test Program in column A, and move the corresponding System number(s) next to the first unique record in columns B through F. Essentially, combining records...

Any ideas on how I can accomplish this?

Thanks in advance,
John
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi jcollinsjr,

Try with the following code:

Code:
Sub Moving_and_Delete_Duplicate_Data()
[COLOR=Green]'César C., 27/Aug/2011
'http://www.mrexcel.com/forum/showthread.php?t=574858[/COLOR]
Dim WF As WorksheetFunction, Lr As Integer, i As Integer, Count as Integer

Set WF = WorksheetFunction
Lr = Range("A" & Rows.Count).End(xlUp).Row

For i = 2 To Lr
    Count = WorksheetFunction.CountIf(Columns("A"), Cells(i, "A"))
    If Count > 1 Then
        Cells(i, "C").Resize(, Count - 1) = WF.Transpose(Range("B" & i + 1 & ":B" & i + Count - 1))
        Range("A" & i + 1 & ":B" & i + Count - 1).Delete Shift:=xlUp
        Cells(1, "B").Copy Destination:=Cells(1, "C").Resize(, Count - 1)
    ElseIf IsEmpty(Cells(i, "A")) Then
        Exit For
    End If
Next
End Sub
Hope this helps.

Regards.
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,503
Members
452,917
Latest member
MrsMSalt

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