Forum Discussion

Connor Crawford's avatar
Connor Crawford
Copper Contributor
Nov 15, 2018

How to Expand Array by appending another elements to it

Hello all. This is my 2nd post!

 

Can anyone show me a good VBA script or a formula not using VBA that will create a new array with the contents of one array in addition to the contents of another array or a single cell value?

 

For example, if i have an array of {1,2,3}, how do I expand that array and add in a value of say 5 from say cell A2 to create a new array {1,2,3,5}. Would also like to know how I would do it if I need to add more than just a single value. Say I want to add {5,2} to make the new array now {1,2,3,5,2}.

 

I've tried a few VBA functions/sub routines online, but I can't seem to get a satisfactory output. Any and all suggestions are appreciated.

 

 

3 Replies

Resources