Filter unique values in a column and sum data in another column

kanishkgarg

New Member
Joined
Sep 29, 2021
Messages
21
Office Version
  1. 365
Platform
  1. Windows
I have a table full of data. What I need to do is the following:

  1. Filter and copy all unique values in one specific column from one sheet (s1) to another(s2). (I have done this)
  2. Filter each unique value and sum up corresponding data in another column.
  3. Filter each unique value and sum the products of data in two corresponding columns(col2 and col3).

The following is a sample of the data I have in the first sheet (s1):

AccountCol2Col3
A24
A35
B26
B34
B22
C33
C24

I am able to only do the following uptil now:

VBA Code:
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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,214,979
Messages
6,122,560
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top