Sumproduct into vba

fraufreda

Board Regular
Joined
Oct 14, 2010
Messages
190
I have the following formula in one of the tables. but due to large data it takes time to recalculate. how can i incorporate it into vba code?

Code:
{SUMPRODUCT(RecTbl[NOD] * (RecTbl[NAME]=[@[ID]]) * (RecTbl[ TYPE]=LBal[[#Headers],[Taken]])*(RecTbl[END DATE]<[@[AsOf]])*(RecTbl[END]-RecTbl[NOD]>=[@[Beg]]))}
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
here is my attempt. Any guidance please
Code:
Dim i As Long
Dim arr() As Long

With Range("RecTbl[NAME]")

ReDim arr(1 To .Rows.Count) As Variant

    For i = LBound(arr) To UBound(arr)
        If arr(i) = TextBox1.Value And arr(i).Offset(0, 3).Value <= AsOf.Value And arr(i).Offset(0, 3).Value - arr(i).Offset(0, 4).Value >= Beg.Value Then
            Select Case arr(i).Offset(0, 1).Value
                Case Label51.Caption
                    Label23.Caption = WorksheetFunction.Sum(arr(i).Offset(0, 4).Value)
            End Select
        End If
    Next
End With
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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