Add all of Column A's, dependant on unique values in Column B

gray_b

New Member
Joined
Apr 17, 2019
Messages
40
Office Version
  1. 365
Platform
  1. Windows
I just cannot get my head around looping.
But I am trying to add all of Column A's, dependant on unique values in Column B
Any ideas please.

A B
Total Country
3 australia
3 australia
4 australia
2 Canada
2 Finland
2 Canada
3 Norway
3 ttxxyyzz
3 australia
4 Norway
4 australia
5 Finland
5 Italy
5 Italy
10 Finland

Result

A B
Grand Total Country
17 australia
4 Canada
17 Finland
7 Norway
3 ttxxyyzz
10 Italy

I can sort column B into unique values
Range("B2:B16").Select
Selection.Copy
Range("E2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range("$E$2:$E$16").RemoveDuplicates Columns:=1, Header:=xlNo
 

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