+ Reply to Thread
Results 1 to 7 of 7

3d array

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    3d array

    I am attempting to read (designated/marked pairs of string values) from a number of (tables on one sheet) into an array.

    The number of tables on the sheet changes over time.

    The number of rows in each table changes over time.

    The number of columns in each table is fixed at two, and when the first of the two columns is marked the items in that row constitute the pair of values.

    The marker for the information from the cells that I want read into the array from each table is that the first cell in each needed row will have a comment created/attached to it.

    Everything in the following blows up (fails) at the point: arReport(intTblCtr) = tbl.name

    tbl.Name is correct, but obviously my handling of assigning values to an array isn't.

    I have more explanation of what I intend to do in the comments of the following code.

    I am probably mis-using the word "parameter" in my attempt to describe the three "positions" (labeled immediately hereafter: "A", "B" and "C": array(A,B,C) ) within the entire array.

    Please Login or Register  to view this content.
    Help?!?

    I did my best to break everything down for I know sometimes I post requests with presumed knowledge of what I am trying to do swimming around in my head!

    Thank-you!
    Last edited by brucemc777; 04-30-2016 at 03:48 PM. Reason: ReDim line of code, now using "1 to"

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,356

    Re: 3d array

    A sample spreadsheet so we can see the data in the spreadsheet will likely be very helpful in visualizing what you are wanting to go into what element of the array.

    Note that this syntax:
    Please Login or Register  to view this content.
    is invalid. arReport is a 3D array, so any assignment statement must reference a single element using all three indices. It is not clear to me exactly where in the array you want to store these pieces of information, but your assignment statement must refer to a single element:
    Please Login or Register  to view this content.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: 3d array

    Please Login or Register  to view this content.
    When you index a 3D array, you need three indices.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: 3d array

    Much appreciated (btw, I previously lived in Cedar Park, TX... )

    From what you wrote I found my concept of a multidimensional array flawed and with additional study figured out something that functions. I don't know how optimized it is (...), but:

    Please Login or Register  to view this content.
    How's it look to you?

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

    Re: 3d array

    The second dimension of the array will only be as large as the number of rows in the last table.

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: 3d array

    It is my intention that intRowCtr should only be overwritten if the present evaluated table's row count is greater than its value; have I done something wrong?

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

    Re: 3d array

    Ah, missed that.

    So, does it all work?

+ 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. Replies: 3
    Last Post: 04-02-2016, 08:16 PM
  2. [SOLVED] Populate one array from another array and print new array as a range
    By Kaden265 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2014, 07:52 AM
  3. Loop new messages containing a table, populate a dynamic array, paste array to Excel
    By laripa in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2013, 07:20 AM
  4. [SOLVED] Quick Array question - Copy array to another array then resize?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-02-2013, 01:17 AM
  5. [SOLVED] Populate Listbox with all rows of a dynamic array where elements of a single array match.
    By Tayque_J_Holmes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-07-2012, 04:54 AM
  6. Single Conditional Array x two Multi-Column Array - Approach needed
    By David Brown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2010, 11:41 AM

Tags for this Thread

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