• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Numbers to merge with separated comma

webmax

Member
Hi

I am attaching the numbers in the excel sheet with each row. Based on the worksheet I want the output to come as the number to be separated with comma in one line.

Sample out put is mentioned below.

7,8,9,11,12,13,14,15

Regards
Shahul
 

Attachments

  • comma.xlsx
    15.7 KB · Views: 3
Hi,

For that amount of cells I can only think of a VBA based solution.
Attached is a subroutine that places the result in "B1".
A similar solution would be a UDF (user defined function). This would allow you to use it as a regular function.

Hope this helps
 

Attachments

  • comma.xlsm
    26 KB · Views: 8
Thanks for the vba shared:)

Can i have the vba for reverse if the number merge in single cell and need to show the in rows each no wise.
 
Thanks for the vba shared:)

Can i have the vba for reverse if the number merge in single cell and need to show the in rows each no wise.
You are welcome ;)

For the reverse see attached.
 

Attachments

  • comma.xlsm
    30.1 KB · Views: 2
By the way, the reverse can be done using the handy "Text to Columns" Excel tool:

1) Select the cell with the comma separated values and click "Text to Columns"... select "Delimited" and "next"
Capturar.JPG

2) Set the delimiter as a comma and "next"
Capturar2.JPG

3) Leave everything as it is and finish:
Capturar3.JPG

4) After the previous steps you should have a row with each value in a different cell starting in "B1". Simply copy the entire range and "PasteSpecial" in "B2" selecting transpose:
Capturar4.JPG

And voilá, no VBA required :)
 
Back
Top