how to sum all values of a variable that's repeated multiple times

  • Thread starter Thread starter NC
  • Start date Start date
N

NC

I have a column where there are several variable, repeated many times.
On the right column the values of the variable ate given.
I want to add up all the values of each unique variable and get a table that
has all unique variables in one column and their corresponding summed up
values on the next cell.
 
Sub sumifunique()
With Range("a1:a" & Cells(Rows.Count, "a").End(xlUp).Row)
.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("E1"), Unique:=True
Range("F1:f" & Cells(Rows.Count, "e").End(xlUp).Row) _
.Formula = "=sumif(a:a,e1,b:b)"
End With
End Sub
 
Back
Top