Store data in array or on a sheet?

XLbyname

New Member
Joined
Nov 18, 2021
Messages
11
Office Version
  1. 2010
Platform
  1. Windows
Hi All,

During a loop I will be picking up five pieces of information relating to about 16,000 people who have ID numbers that could be anything from 1 to 700,000. I need to store this info and refer to it during the loop.

My question is, if I turn off screenupdating, will Excel be able to store and retrieve the information more quickly and stably (ie without risks of overwhelming memory leaks) if I use 5 one-dimension arrays, 1 two-dimensional array or simply store the information in a worksheet?

There will only be about 16,000 people stored in total, but I feel I would need to store them in a 700,000-sized array so I can quickly refer to DOB(i) rather than constantly searching for a matching ID in a smaller array of only 16,000.

Should I store DOB for person 999 as?
  1. DOB(999)=DOB
  2. Person(999,2)=DOB
  3. .cells(999,2).value=DOB
Thanks for your help!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
It will be much much faster to store the data in either 5 one dimensional arrays or 1 two dimensional arrays. Which is faster or better out of those two, I don't know . I would use which ever is easiest to code because I suspect it doesn't make much difference. Unlike storing on the worksheet which is going to be very very slow!!
 
Upvote 0
Solution

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top