hello,
I'm using the following code and I'm getting a stack overflow error in Excel 2007...does anyone know how to solve this problem??
Option Explicit
Sub ertert()
Dim x(), i&, j&, k&, s$
With Range("A1").CurrentRegion
x = .Value: .ClearContents
End With
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For i = 1 To UBound(x)
s = x(i, 1) & "|" & x(i, 2)
If .Exists(s) Then
k = .Item(s): x(k, 3) = x(k, 3) & ", " & x(i, 3)
Else
j = j + 1: .Item(s) = j
x(j, 1) = x(i, 1)
x(j, 2) = x(i, 2)
x(j, 3) = x(i, 3)
End If
Next i
End With
Range("A1:C1").Resize(j).Value = x()
End Sub
Bookmarks