I want to build a comma delimited string from Range A1:A400.
What is the best way of doing this? Should I use a For loop?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The laziest way is
This works because
.Valueproperty of a multicell range returns a 2D array, andJoinexpects 1D array, andTransposeis trying to be too helpful, so when it detects a 2D array with just one column, it converts it to a 1D array.In production it is advised to use at least a little bit less lazy option,
otherwise the active sheet will always be used.