+ Reply to Thread
Results 1 to 8 of 8

join values in range

  1. #1
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    join values in range

    Hello again friends,

    I'm trying to join multiple values in a range into a coma separated string. I used the following code:

    Please Login or Register  to view this content.
    If you can help pls?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: join values in range

    You can only JOIN a 1 dimensional array, when you populate an array from a range it creates a 2 dimensional one. You'll need to transpose the array first.
    If someone has helped you then please add to their Reputation

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: join values in range

    I've tried your suggestion but same result:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: join values in range

    Please Login or Register  to view this content.
    Please click the * below if this helps

  5. #5
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: join values in range

    like a charm! thank you!
    Why is that working?
    What is different now?

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: join values in range

    I'm getting an error because your procedure is named join, so I changed that and used transpose twice and it works fine.
    To answer your question, when you populate you array with data that's all in a row you get an array that's 1 row and 10 columns. When you use transpose you change that to an array that is 1 column and 10 rows and when you transpose that you get a 1d array of 10 items. So transpose(transpose) does that in one line of code. If your data starts in a column say A1:A10 then you only need transpose once.
    Run the following code line by line and look at how arr changes in the locals window.

    Please Login or Register  to view this content.
    Last edited by skywriter; 09-22-2015 at 05:04 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  7. #7
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: join values in range

    thank you guys!

  8. #8
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: join values in range

    Thanks for the rep. points.

+ 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] How to join values to changing list?
    By ranuc in forum Excel General
    Replies: 1
    Last Post: 08-10-2014, 12:47 PM
  2. How to join values when same condition?
    By ginkgo56 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 06:58 PM
  3. [SOLVED] Function for join Cell in range
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2013, 11:16 AM
  4. Need to join two values together into one field
    By p3x935 in forum Excel General
    Replies: 3
    Last Post: 11-12-2012, 01:27 PM
  5. [SOLVED] Excel 2007 : join cells with 00 values
    By maria a in forum Excel General
    Replies: 12
    Last Post: 06-16-2012, 11:56 AM
  6. [SOLVED] How do I join a range of cells?
    By BPB in forum Excel General
    Replies: 1
    Last Post: 04-12-2006, 01:50 PM
  7. join columns, keep both values
    By FourPenny in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-30-2005, 08:36 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