How to perform SumIf using VBA on an array in Excel

后端 未结 3 548
一向
一向 2020-12-10 00:19

I\'m trying to come up with the fastest way to perform a SumIf function in Excel on a dataset that has approx. 110\'000 lines. I\'ve come up with three ways, but none of the

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 00:51

    Give this a whirl

    Sub test()
        StartTimer = Now()
        With ActiveSheet.Range("D2:D6285")
            .FormulaR1C1 = "=SUMIF(Tabelle1[KUNDENBESTELLNR],Test!RC[-3],Tabelle1[ANZAHL NACHFRAGE])"
            .Value = .Value
        End With
        EndTimer = Now()
        MsgBox (DateDiff("s", StartTimer, EndTimer))
    End Sub
    

提交回复
热议问题