Is it what you want ...?
See next code, much be launch from sheet with data
Take care that original data is deleted
Option Explicit
Sub Treat()
Dim KeyDic As Object
Set KeyDic = CreateObject("Scripting.Dictionary")
Dim LR As Integer, I As Integer
Const FR As Integer = 2
Dim AAA, BBB
Dim WkKey As String
LR = Cells(Rows.Count, "A").End(3).Row
For I = FR To LR
WkKey = Cells(I, "A")
If (WkKey Like "*-*") Then
If Not (KeyDic.exists(WkKey)) Then
KeyDic.Item(WkKey) = Cells(I, "A").Offset(1, 0).Value
End If
End If
Next I
Cells.ClearContents
With KeyDic
Cells(2, 1).Resize(.Count, 1) = Application.Transpose(.keys)
Cells(2, 2).Resize(.Count, 1) = Application.Transpose(.items)
End With
End Sub
Bookmarks