이것이 내가 원하는거야.
열 A에서 중복 병합
열 B에서 식별자를 통해 끌어 오기 열 B
에서 열 값 합계
Sub SkuSorter()
Dim x As Long, y As Long
Dim rng As Range
Dim wSrc As Worksheet: Set wSrc = Sheets("AR Received SKU's List 1")
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With wSrc
x = .Range("A" & .Rows.Count).End(xlUp).Row
Set rng = .Range("A1:A" & x)
y = .Cells(1, .Columns.Count).End(xlToLeft).Column + 2
rng.AdvancedFilter Action:=xlFilterCopy, copytoRange:=.Cells(1, y), unique:=True
Z = .Cells(.Rows.Count, y).End(xlUp).Row
y = y + 1
.Cells(1, y).Value = "Total"
.Range(.Cells(2, y), .Cells(Z, y)).Formula = _
"=SUMIF(" & rng.Address & "," & .Cells(2, y - 1).Address(False, False) & "," & rng.Offset(, 1).Address & ")"
End With
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub