简体   繁体   中英

combine multiple excel values from an array back into a single excel cell comma separated

I have multiple values that I'm reading into an array, but I need to paste those values into a single cell comma separated. Is this possible?

You can Join an array with a given separator

myArray = Array("John","Bob","Mary")     
sString = Join(myArray, ",")
msgbox sString

Will give you "John,Bob,Mary" in sString...

To put this into a cell: Worksheets("Sheet1").Range("A1").Value = sString

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM