Sum-ifs VBA

rockchalk33

Board Regular
Joined
Jan 12, 2016
Messages
111
Hey all,

So I am stuck on quite a large project. I have a sheet with a list on names in column A...the rest of the columns (B through I) are numerical values associated with that name.

Here's the rub...there could be only the one one, two, or even up to twelve different rows all containing the same name but different numerical values in the respective columns.

I need to a subroutine to add up all the values in columns "B" that have the same name in column A, columns "C" that have the same name in columns A, repeating this process through column "I"....while simultaneously deleting the row after the summation has occurred.

I can't seem to figure this one out at all and can't find any answers online. PS the data will already be in alphabetical/numerical order

Thanks for the help!!!

Example:

Devin 1 2 3 5 7
Jorden 2 2 2 2 2
Jorden 3 4 7 7 2
Jorden 0 1 1 1 2
Jorden 1 1 2 3 4
Lydia 5 7 9 0 3
Lydia 1 1 1 6 9
Phil 2 7 9 1 0

Would ultimately look like this (without any spaces between rows):

Devin 1 2 3 5 7
Jorden 6 8 13 13 10
Lydia 6 8 10 6 12
Phil 2 7 9 1 0
 
rockchalk33,

Your link has additional images?????


You can post your workbook/worksheets to the following free site (sensitive data changed), mark the workbook for sharing, and, provide us with a link to your workbook:

https://dropbox.com

hiker95,

I ended up getting it figured out!

However I am having a slight issue with my filter of unique variables

I have column A with these values starting at row 2:

9
9
0
0
9
9
10
143
10
11
11

When using this macro:

Code:
    Dim ws As Worksheet, sh As Worksheet    Dim rng As Range, Frng As Range


    Set ws = Sheets("Sheet6")
    Set rng = ws.Range("A2")
    Set sh = Sheets("Sheet4")
    Set Frng = sh.Range("A2:A1048576")


    Frng.AdvancedFilter Action:=xlFilterCopy, copytorange:=rng, Unique:=True

I am getting this on Sheet6....I am unsure as to why I am getting two 9's to start off with?....

Column A starting at row 2:

9
9
0
10
143
11
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
rockchalk33,

Without seeing your actual raw data worksheet(s), and, what the results should look like, it is difficult to see the logic to solve your request.

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,017
Members
448,937
Latest member
BeerMan23

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