im newbie for vba programming, i have more than 44K rows of data and have 3 column A,B,C. and i want to merge that based on column A as key. i used code from this forum in this link http://www.ozgrid.com/forum/showthread.php?t=156024, my problem is code always return error 400 when i executed this
Code
Sub test()
Dim a, i As Long, ii As Long, n As Long, x As Long, flg As Boolean
a = Sheets("sheet1").Range("a1").CurrentRegion.Value
n = 1
With CreateObject("Scripting.Dictionary")
For i = 2 To UBound(a, 1)
If Not .exists(a(i, 1)) Then
n = n + 1
.Item(a(i, 1)) = n
flg = True
End If
x = .Item(a(i, 1))
If flg Then
For ii = 1 To UBound(a, 2)
a(x, ii) = a(i, ii)
Next
Else
a(x, 2) = a(x, 2) & ";;" & a(i, 2)
a(x, 3) = a(x, 3) & ";;" & a(i, 3)
End If
flg = False
Next
End With
Application.DisplayAlerts = False
On Error Resume Next
Sheets("result").Delete
On Error GoTo 0
Sheets.Add(after:=Sheets("sheet1")).Name = "Result"
With Sheets("result").Cells(1).Resize(n, UBound(a, 2))
'.Columns("r").NumberFormat = "@"
.Value = a
.EntireColumn.AutoFit
End With
End Sub
Display More
basically my file contain data like here
A B C
12 a b
12 c d
13 a ee
.
.
.
my goal file like here
A B C
12 a,c b,d
13 a ee
.
.
.
more details for my file in attachment
can give me solution? thanks so much