+ Reply to Thread
Results 1 to 11 of 11

Join all items in multidimensional array

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Join all items in multidimensional array

    Hi,

    i have ArrayTest(1 to 3):
    ArrayTest(1,1): "Ok"
    ArrayTest(1,2): "Ok2"
    ArrayTest(1,3): "Ok3"
    ArrayTest(1,n): "Okn"

    In can be here ifinity of elements in 2nd dimension.

    How can i join them?

    join(array(ArrayTest(1,1),ArrayTest(1,2),ArrayTest(1,3),ArrayTest(1,n), "/")

    Thank you for help,
    Jacek

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Join all items in multidimensional array

    Hi jaryszek,
    maybe something like this
    Please Login or Register  to view this content.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Join all items in multidimensional array

    It would be helpful to see the code that declares and populates the array. You may be able to use Index to extract the entire 'row' into an array and join it that way, or you could simply loop.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Join all items in multidimensional array

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Join all items in multidimensional array

    Thank you Guys,

    your code AlphaFrog is working but i can not use split function here:

    MyString = Split(MyString, "/") throws error.

    Mystring will be added as item into dictionary key and to get easy item from here i will be using split function.

    Maybe xlnitwit index function will be better?

    MyString = Application.WorksheetFunction.Index(MyArray, 1, 1)
    equals Test1...

    Jacek

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Join all items in multidimensional array

    MyString = Split(MyString, "/")

    MyString is a String type variable. The Split function returns an array. Try something like this...

    Dim MySplit As Variant
    MySplit = Split(MyString, "/")

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Join all items in multidimensional array

    thank you AlphaFrog!
    It is working like a charm.

    What about

    You may be able to use Index to extract the entire 'row' into an array
    thank you!

  8. #8
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Join all items in multidimensional array

    Hello,

    any pther solutions with index function?

    Jacek

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

    Re: Join all items in multidimensional array

    You mean like this?
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Join all items in multidimensional array

    Wow jindon Master!

    thank you my friend,
    exactly it was what i meant

    Jacek

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

    Re: Join all items in multidimensional array

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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: 7
    Last Post: 03-12-2017, 03:20 PM
  2. join multidimensional array vba
    By shs91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2016, 04:07 PM
  3. help with sorting multidimensional array
    By jyl7 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-24-2013, 08:23 PM
  4. Using the ReDim array function in a multidimensional array in excel
    By Doruli in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2012, 01:43 PM
  5. Multidimensional Array
    By sidd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2009, 09:57 PM
  6. Multidimensional array
    By gwithey in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 02-02-2009, 12:15 PM
  7. Syntax for multidimensional array
    By Arne Hegefors in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2006, 01:25 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