+ Reply to Thread
Results 1 to 3 of 3

Using jagged array to associate one to many

  1. #1
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    Using jagged array to associate one to many

    Hi,
    I have built the this code to simplify what I'm trying to accomplish.
    How would I know what colors steve likes or anybody else in the list?
    Thanks for anybody who helps.

    PHP Code: 
    Sub test()
    Dim names() As Variant
    Dim things
    () As String

    ReDim names
    (3)
    names(1) = "Steve"
    names(2) = "Jack"
    names(3) = "Tobias"
    "red"
    "blue"
    "white"

    1
    For 1 To UBound(names)
        
       If 
    1 Then
        ReDim Preserve things
    (2)
        
    things(1) = a
        things
    (2) = b
        names
    (1) = things
        End 
    If

    If 
    2 Then
        ReDim Preserve things
    (1)
        
    things(1) = c
        names
    (2) = things
        End 
    If

    If 
    3 Then
        ReDim Preserve things
    (3)
        
    things(1) = c
        things
    (2) = a
        things
    (3) = b
        names
    (3) = things
        End 
    If

     
    Next i

    End Sub 

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: Using jagged array to associate one to many

    1) One way based on your code.
    Please Login or Register  to view this content.
    2) Have you tried Dictionary object?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    Re: Using jagged array to associate one to many


    Holy cow!!! Thank you so much. I haven't been able to test the code yet but it makes perfect sense to me.
    As far as a dictionary object, I have absolutely no clue about it. I'll have to start reading up on it and see what its about. Thank you again.
    Last edited by tobias1010; 07-14-2018 at 11:03 PM.

+ 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. Jagged Array vba
    By tobias1010 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2018, 01:37 PM
  2. [SOLVED] Paste "Jagged Array" without looping
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 04-16-2017, 08:00 PM
  3. [SOLVED] Jagged Arrays: Syntax Clarificatiuon
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2016, 05:46 PM
  4. [SOLVED] Jagged Array Excel Formula?
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-11-2015, 07:45 PM
  5. [SOLVED] Print to worksheet and Jagged Array
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2012, 07:50 PM
  6. Get error when declaring a jagged array?
    By HammerTime in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2010, 11:16 PM
  7. Jagged Pie Charts
    By Sionos in forum Excel General
    Replies: 0
    Last Post: 09-25-2007, 05:54 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