Hello again friends,
I'm trying to join multiple values in a range into a coma separated string. I used the following code:
If you can help pls?Please Login or Register to view this content.
Hello again friends,
I'm trying to join multiple values in a range into a coma separated string. I used the following code:
If you can help pls?Please Login or Register to view this content.
.. and don't forget to have fun!
Bogdan.
mark SOLVED and Add Reputation if my answer pleases you
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
I've tried your suggestion but same result:
Please Login or Register to view this content.
Please Login or Register to view this content.
Please click the * below if this helps
like a charm! thank you!
Why is that working?
What is different now?
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.
thank you guys!
Thanks for the rep. points.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks