Sub test_mat_array()
With ActiveWorkbook
.Names.Add Name:="ArrTemp", RefersToR1C1:="={1,2,3,4,5,6,7,8,9,10}"
.ActiveSheet.Cells(1, 1).Value = Evaluate("=SUMPRODUCT(--(ArrTemp>=1),--(ArrTemp<=5))")
.Names("ArrTemp").Delete
End With
End Sub
Why this macro does not work
Sub test_mat_array()
Array_1 = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
test_2 = Application.WorksheetFunction.Sum((Array_1 >= 1) * (Array_1 <= 5))
Cells(1, 1) = test_2
End Sub
thank you