Hello,
I found very helpsome tips by searching in this forum and came across the use of Excel functions like Dsum and SumProduct for applying multiple conditions. However I can't get these functions to work (properly) in VBA.
In the example code the syntax of the code between the brackets after SumProduct is not correct. I have tried several variants, but couldn't find the solution.
Can anyone help me with the correct notation?
Set myRange1 = ActiveWorkbook.Worksheets("Blad1").Range("A1:A5")
Set myRange2 = ActiveWorkbook.Worksheets("Blad1").Range("C1:C5")
Set myRange3 = ActiveWorkbook.Worksheets("Blad1").Range("D1
5")
Sum = Application.WorksheetFunction.SumProduct((myRange1 = "Text1") * (myRange2 = "Text2") * myRange3)
I found very helpsome tips by searching in this forum and came across the use of Excel functions like Dsum and SumProduct for applying multiple conditions. However I can't get these functions to work (properly) in VBA.
In the example code the syntax of the code between the brackets after SumProduct is not correct. I have tried several variants, but couldn't find the solution.
Can anyone help me with the correct notation?
Set myRange1 = ActiveWorkbook.Worksheets("Blad1").Range("A1:A5")
Set myRange2 = ActiveWorkbook.Worksheets("Blad1").Range("C1:C5")
Set myRange3 = ActiveWorkbook.Worksheets("Blad1").Range("D1
Sum = Application.WorksheetFunction.SumProduct((myRange1 = "Text1") * (myRange2 = "Text2") * myRange3)