'Filter unique values in a column and sum data in another column
I have a table full of data. What I need to do is the following:
Filter and copy all unique values in one specific column from one sheet (s1) to another(s2). (I have done this)
Filter each unique value and sum up corresponding data in another column.
Filter each unique value and sum the products of data in two corresponding columns(col2 and col3).
I am able to only do the following uptil now:
Sub CopyUnique()
Dim s1 As Worksheet, s2 As Worksheet
Dim tempLast As Long
Dim lr As Long
Set s1 = Sheets("Bericht1")
Set s2 = Sheets("Sheet1")
s1.Range("E:E").Copy s2.Range("c1")
s2.Range("A:A").RemoveDuplicates Columns:=1, Header:=xlNo
tempLast = s2.Cells(Rows.Count, "A").End(xlUp).Row
End Sub
The following is a sample of the data I have in the first sheet (s1):
| Account | Col2 | Col3 |
|---|---|---|
| A | 2 | 4 |
| A | 3 | 5 |
| B | 2 | 6 |
| B | 3 | 4 |
| B | 2 | 2 |
| C | 3 | 3 |
| C | 2 | 4 |
Any help would be appreciated!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
