+ Reply to Thread
Results 1 to 6 of 6

Maximum size of an array in excel 2016

  1. #1
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    Maximum size of an array in excel 2016

    I am trying to use an array to populate a column of around 300,000 rows. The routine gives N/A after 30,000 (10% of what I want). What's the maximum number of elements for an array (to simplify it let's say one dimension - redim arr(1 to bigNum) in excel 2016? How can I get it to work? I can't use loops to populate as it's taking way long. Any help appreciated!

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Maximum size of an array in excel 2016

    300K rows isn't really a problem. How do you fill your array ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Maximum size of an array in excel 2016

    It's the basic manipulation such as taking one column with replacing some values. Did you have no issues with the size of an array at all? Maybe it's just my computer.


    I did find a solution but I may not remove this thread since some others may have the same issue. This is one way to do it if the size is too big: redim preserve (1 to bigNum, 1 to 1). It works like a magic. Thanks for the reply!
    Last edited by aprildu; 04-15-2019 at 05:55 PM.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,537

    Re: Maximum size of an array in excel 2016

    Just for the heck of it, I filled 350,000 cells and multiplied the values by 2.
    Filled the Cells so
    Please Login or Register  to view this content.
    Then I ran this code
    Please Login or Register  to view this content.
    On several runs it took 0.36 seconds/run

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Maximum size of an array in excel 2016

    Are you using worksheet formulas like transpose on your array? They could give that symptom, don’t use them

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Maximum size of an array in excel 2016

    Redim Preserve is very resource exhaustive, espescially on big arrays since the y have to be recalculated every time. It's to be avoided as much as possible.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2016 Exports PDF 10x the size of Excel 2013
    By oiltech999 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-16-2017, 07:20 PM
  2. Replies: 1
    Last Post: 09-18-2017, 08:27 AM
  3. Maximum size of an Excel file to prevent corruption
    By Christian411 in forum Excel General
    Replies: 3
    Last Post: 02-25-2009, 01:10 PM
  4. Maximum size for cube created in Excel 2003?
    By McP in forum Excel General
    Replies: 0
    Last Post: 07-28-2006, 02:35 PM
  5. [SOLVED] What is the maximum file size Excel can save?
    By IDBS in forum Excel General
    Replies: 3
    Last Post: 05-25-2006, 10:55 AM
  6. [SOLVED] Excel Maximum size ?
    By Gustav in forum Excel General
    Replies: 1
    Last Post: 03-06-2006, 11:05 AM
  7. how do I increase maximum worksheet size in Excel?
    By mherron in forum Excel General
    Replies: 2
    Last Post: 02-03-2006, 02:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1