David Evans
Active Member
Ninjas -
Why would this code work in a cell and in an adjacent cell, return #value?
Why would this code work in a cell and in an adjacent cell, return #value?
Code:
Function SumIntervalCols(WorkRng As Range, interval As Integer) As Double
Dim arr As Variant
Dim total As Double
Dim j As Double
total = 0
arr = WorkRng.Value
For j = interval To UBound(arr, 2) Step interval
total = total + arr(1, j)
Next
SumIntervalCols = total
End Function
Last edited by a moderator: