Is there a way to add a constant to an array of numbers in Excel VBA (Excel 2007) without looping?
For instance, I have the following array:
MyArray = (1,2,3,4,5)
And I want to obtain:
MyArray = (2,3,4,5,6)
Without looping.
On the Spreadsheet, if the values are in cells A1:A5
, I can select B1:B5
and enter the array formula {=A1:A5+1}
MyArray = MyArray + 1
does not seem to work (Type mismatch error).
Any ideas?