I am fairly new to VBA, so this may be a simple question but here goes.
I would like to initialize an entire array myArray, say of integers, in VBA. I k
This function works with variables for size and initial value it combines tbur & Filipe responses.
Function ArrayIniValue(iSize As Integer, iValue As Integer)
Dim sIndex As String
sIndex = "INDEX(Row(1:" & iSize & "),)"
ArrayIniValue = Evaluate("=Transpose(" & sIndex & "-" & sIndex & "+" & iValue & ")")
End Function
Called this way:
myArray = ArrayIniValue(350, 13)