Make a cell equal the sum of selected cells

Wrathor

New Member
Joined
Jun 23, 2011
Messages
10
I'm working in a spreadsheet that has duplicate items with corresponding values to the items, and i'm trying to consolidate them.

I have a free cell in "C1" where i would like to aggregate values of duplicate items.

Where I'm having trouble is aggregating the data into the open cell. I know I can enter the following code for making the open cell equal to my selection, but i'm wondering if there is a way to make the open cell equal to the sum of my selected cells.

Range("C1") = Selection.Value

Any help would be greatly appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
It worked!

I use the following code to do the aggregation, then make my first selected cell in the active cells equal to the aggregated amount.

Code:
Range("C1").Value = WorksheetFunction.Sum(Selection)
ActiveCell.Value = Range("C1").Value

Thanks a million for your quick and accurate help as always MrExcel users!
 
Upvote 0

Forum statistics

Threads
1,223,606
Messages
6,173,323
Members
452,510
Latest member
RCan29

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