VBA – Repeat SUMIFS Formula for Unique Combinations of Rows

Status
Not open for further replies.

msmna93

New Member
Joined
Dec 31, 2018
Messages
2
Hello everyone.

I am a VBA beginner. I need your help to solve my problem.

Suppose that I have an Excel table with the following fields:

D: Account
L: Amount
M: Category
N: Value Day

What I need to do is the following:


  1. Compute the conditional sums of the amounts by all possible unique combinations of accounts, categories and value days that are shown in the table until the Last Row.
  2. Store the values coming from point 1 in a 3D array (without printing them in an Excel sheet)

Here is the code where I'd need to build on.

Dim LastRow As Long
LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row

Application.WorksheetFunction.Sumifs(Range("L2:L" & LastRow), Range("D2:D" & LastRow), "IBAN N.1", Range("M2:M" & LastRow), "Foreign Receipt", Range("N2:N" & LastRow), "27")

Any help is deeply appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Status
Not open for further replies.

Forum statistics

Threads
1,214,894
Messages
6,122,124
Members
449,066
Latest member
Andyg666

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