+ Reply to Thread
Results 1 to 3 of 3

Load Values To Array Using .CurrentRegion With Array Base 0

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Load Values To Array Using .CurrentRegion With Array Base 0

    Hi,

    I have random numbers in Cell A1:D3.

    Using this code, I can store values to a 2-D array.

    Please Login or Register  to view this content.
    The problem here is, the Lbound of the Array starts with 1.

    I would like to know which is the best way to get the same array, but the bounds to start from 0?

    What I currently do is, make a similar array and redim it with the Bounds of the previous array subtracted by 1 and then load values to it from the 1st array.

    Not sure if this is the most efficient approach.
    Last edited by NeedForExcel; 08-01-2016 at 07:14 AM.
    Cheers!
    Deep Dave

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Load Values To Array Using .CurrentRegion With Array Base 0

    Even if you set the option to 0, it will not make any difference, if you load a range in to an array, it always produces a two-dim, starting with 1.
    Last edited by AB33; 08-01-2016 at 07:47 AM.

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Load Values To Array Using .CurrentRegion With Array Base 0

    Yes, I am aware of that..

    This is just for the sake of knowledge that I am trying to understand.

    I just want the same array with the base 0 and not 1. (I am now talking about the Option Base Statement, I am just trying to figure out if there is any other way)

+ 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. [SOLVED] Look within a large array of values for a small array that meets a certain criteria
    By sean2222 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2016, 11:41 AM
  2. Load an array from ADO recorset
    By cgkmal in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-18-2014, 04:07 PM
  3. Create an array based off values in another array - exclude blanks
    By clifton1230 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2013, 05:35 PM
  4. Replies: 19
    Last Post: 05-09-2012, 03:31 AM
  5. Find a value in an array and return multiple values in an adjacent array
    By tonbra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 08:35 PM
  6. Load Values into Array to Compare
    By prescient in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2009, 05:11 PM
  7. String array values to array of User-Defined Types
    By rtiltins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2008, 07:45 AM

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