+ Reply to Thread
Results 1 to 5 of 5

Array Size & Dimensions Best Practice

  1. #1
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Array Size & Dimensions Best Practice

    Hi,

    Generally speaking, does anyone have any suggestions regarding best practice for VBA array size & dimensions?

    In my case, I'm thinking what the best path would be, given an array w/5-6 dimensions, containing approximately 1500 elements in each dimension.

    I can either load each separately into its own array or create a single array with multiple dimensions, since each series is related. I will later perform basic math on the arrays.

    Are there any typical stumbling blocks that the group can think of which are avoidable using one route or the other?

    Any pointers are appreciated.

    Thanks =)

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Array Size & Dimensions Best Practice

    given an array w/5-6 dimensions ...
    I think you mean an array with two dimensions, one of which is 5 or 6.

    It depends on the types of operations you will be doing. If you would be summing values in a given 'row,' then it would be faster to have a single 2D array than 5 or 6 separate 1D arrays.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Array Size & Dimensions Best Practice

    Hi Shg

    Thanks for the response.

    Maybe I'm visualizing it wrong, not a VB guy by background.

    Effectively, it would have 5-6 columns w/variant data types (mostly doubles and dates).

    There would be 5-6 data points within each interval of the time series, extending in a chronological manner to ~1500 intervals.

    Would it be considered a 2D array or a 5-6D array? I'm not sure the correct way to express it, thus the question.

    Thanks for your help =)

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Array Size & Dimensions Best Practice

    Two dimensions:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Array Size & Dimensions Best Practice

    Cool thanks for your help. =)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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