An Excel Visual Basic Macro by Troy M. Goss (as work for hire) Created in Windows 7 Excel © 2012 Used to compare extremely large data sets (1000+) Sub UnStacker() ' ' UnStacker Macro ' '' Input: List of Keeps&Merges 2 columns Output: List of Keeps&Merges 1 column front dup removed Sheets("Format UnStacker").Select Dim BDone Dim BSets Dim BTotal Dim WIN Dim LID Dim BCount Dim Group Dim NumData Dim Skip Dim Offset Dim CSTATUS Dim CCHECK Dim CKEEP Dim CNEXT Dim x Dim CKM_Row, STK_Row Dim CKM_Col, STK_Col ' Initialize variables BSets = 0 BItems = 0 BTotal = 0 BDone = 1 BCount = 1 Group = 1 Skip = 0 CKM_Row = 1 CKM_Col = 1 USTK_Row = 2 USTK_Col = 6 'Application.ScreenUpdating = False While BDone <> "" 'Check if Done Range("A1").Select 'reset Selection.Cells(CKM_Row + BCount, CKM_Col).Select CKEEP = ActiveCell.FormulaR1C1 'Pickup Current- Listing ID's Range("A1").Select 'reset Selection.Cells(CKM_Row + BCount, CKM_Col + 1).Select CCHECK = ActiveCell.FormulaR1C1 'Pickup Current- Groupings Range("A1").Select 'reset Selection.Cells(CKM_Row + BCount, CKM_Col + 2).Select CSTATUS = ActiveCell.FormulaR1C1 'Pickup Current- Status Range("A1").Select 'reset Selection.Cells(CKM_Row + BCount + 1, CKM_Col + 1).Select CNEXT = ActiveCell.FormulaR1C1 'Pickup Next- Groupings BDone = ActiveCell.FormulaR1C1 'Pickup Next- BDone If CSTATUS = "Winner" Then WIN = CKEEP ' Keep winning LID for Set If CNEXT = 1 Then For x = 1 To Group Range("A1").Select 'reset Selection.Cells(CKM_Row + Offset + x, CKM_Col).Select NumData = ActiveCell.FormulaR1C1 'Pickup L1 If WIN = NumData Then Skip = 1 End If Select Case Skip Case 1 'reset Skip Skip = 0 Case Else 'Post winner & Next LID Range("A1").Select 'reset Selection.Cells(USTK_Row, USTK_Col).Select ActiveCell.FormulaR1C1 = WIN 'Dumpoff Winner Range("A1").Select 'reset Selection.Cells(USTK_Row, USTK_Col + 1).Select ActiveCell.FormulaR1C1 = NumData 'Dumpoff L2 USTK_Row = USTK_Row + 1 'Increment Row BTotal = BTotal + 1 'Increment LID count End Select Next x Offset = (Offset + x) - 1 BSet = BSet + 1 Group = 1 Else Group = Group + 1 End If BCount = BCount + 1 Wend 'Last One For x = 1 To Group Range("A1").Select 'reset Selection.Cells(CKM_Row + Offset + x, CKM_Col).Select NumData = ActiveCell.FormulaR1C1 'Pickup L1 If NumData = "" Then Skip = 1 If WIN = NumData Then Skip = 1 End If Select Case Skip Case 1 'reset Skip Skip = 0 Case Else 'Post winner & Next LID Range("A1").Select 'reset Selection.Cells(USTK_Row, USTK_Col).Select ActiveCell.FormulaR1C1 = WIN 'Dumpoff Winner Range("A1").Select 'reset Selection.Cells(USTK_Row, USTK_Col + 1).Select ActiveCell.FormulaR1C1 = NumData 'Dumpoff L2 USTK_Row = USTK_Row + 1 'Increment Row BTotal = BTotal + 1 'Increment LID count End Select Next x Offset = (Offset + x) - 1 BSet = BSet + 1 Group = 1 Range("A1").Select Beep MsgBox (BTotal + 1 & " Rows in list / " & BSet & " Group(s) -> Done and Done!") End Sub