Hi guys
is there any way to change this code please?
what I want implementing code for table and loop for multiple sheets.
every sheet contains table and contains three columns A,B,C . the item is in column B and numeric values in column C . so should merge duplicates items across sheets into one sheet " OUTPUT".
thanks
is there any way to change this code please?
what I want implementing code for table and loop for multiple sheets.
every sheet contains table and contains three columns A,B,C . the item is in column B and numeric values in column C . so should merge duplicates items across sheets into one sheet " OUTPUT".
VBA Code:
Sub MG02Sep59()
Dim Rng As Range, Dn As Range, n As Long, nRng As Range, ws As Worksheet
Set Rng = Range(Range("B2"), Range("B" & Rows.Count).End(xlUp))
With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
For Each Dn In Rng
If Not .exists(Dn.Value) Then
.Add Dn.Value, Dn
Else
If nRng Is Nothing Then Set nRng = _
Dn Else Set nRng = Union(nRng, Dn)
.Item(Dn.Value).Offset(, 1) = .Item(Dn.Value).Offset(, 1) + Dn.Offset(, 1)
End If
Next