Forum Discussion
excel vba arrays filling one dim array with 2dim array
- Aug 08, 2022
While VBA can easily handle three-dimensional (and higher) arrays, Excel cannot store them directly: a worksheet is a two-dimensiona array of rows and columns.
The reply on Stack Overflow proposes to create a one-dimensional array - think something like {item1, item2, item3, ...} in which each item is a two-dimensional array. So item1 would be an array of rows and columns, item2 would be another array of rows and columns, etc.
Each of these items can be stored on a worksheet.
But I don't see how this relates to the question in the first post.
- HansVogelaarAug 08, 2022MVP
Please try to explain as clearly as you can what you want.
- adnan2004Aug 08, 2022Copper Contributor
Excuse me, can you explain to me this sentence in this link?
https://stackoverflow.com/questions/39821883/vba-3-dimensional-array
(" The practical way storing the data is to have a 1D array filled with 2D arrays. This will allow you to use standard techniques to work with thee data.")- HansVogelaarAug 08, 2022MVP
While VBA can easily handle three-dimensional (and higher) arrays, Excel cannot store them directly: a worksheet is a two-dimensiona array of rows and columns.
The reply on Stack Overflow proposes to create a one-dimensional array - think something like {item1, item2, item3, ...} in which each item is a two-dimensional array. So item1 would be an array of rows and columns, item2 would be another array of rows and columns, etc.
Each of these items can be stored on a worksheet.
But I don't see how this relates to the question in the first post.