I'm trying to create that would resample a range by basically repeating values gain. For example {1,2,3} would become {1,1,2,2,3,3}. For some reason my function only returns 0 all the time. Can someone help?

Function Test(myArray As Range, up As Integer)
Dim upArray() As Double, i As Integer, j As Integer, Arr As Variant
Arr = myArray

ReDim upArray(UBound(Arr) * up)

For i = 1 To UBound(Arr)
    For j = 1 To up
        upArray(up * (i - 1) + j) = Arr(i, 1)
    Next j
Next i

Test = upArray
End Function