Simplist approach to convert 1D array to 2D array

YasserKhalil
PlatinumLounger
Posts: 4931
Joined: 31 Aug 2016, 09:02

Simplist approach to convert 1D array to 2D array

Post by YasserKhalil »

Hello everyone
I have 1D array with 1 million items .. and I need to convert it to 2D array
I know Application.Transpose can do the trick but it will not work with this large arrays
Any ideas?

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Simplist approach to convert 1D array to 2D array

Post by HansV »

I fear you'll have to write a loop...
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4931
Joined: 31 Aug 2016, 09:02

Re: Simplist approach to convert 1D array to 2D array

Post by YasserKhalil »

Thanks a lot, Mr. Hans for reply. I am trying to avoid loops to make the code faster.

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Simplist approach to convert 1D array to 2D array

Post by HansV »

I understand, but I don't know how to avoid a loop here.
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4931
Joined: 31 Aug 2016, 09:02

Re: Simplist approach to convert 1D array to 2D array

Post by YasserKhalil »

I remember something related to using INDEX function for such a purpose..!

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Simplist approach to convert 1D array to 2D array

Post by HansV »

:shrug:
Best wishes,
Hans