Change allingment and add a comma

MDuff

Well-known Member
Joined
Dec 29, 2002
Messages
529
Hi all does some one know an easy wat to turn what is show below in to this 309,317,801 etc.
Moto splits.xls
BCDE
4309310803
5317311804
6801313
7802314
8805316
9813811
10814823
11815
12816
13818
14820
15821
Sheet1


thanks a lot
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

can you not format them as ###","

or are you joining the numbers together?
 

MDuff

Well-known Member
Joined
Dec 29, 2002
Messages
529
onlyadrafter


I need to Join all the numbers together but as a string

"309,317,801..." etc

thanks
 

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

are you joining every cell shown, or just each cell in each column?
 

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

for a VB version use

Code:
Sub concat()
For MY_COLS = 1 To Range("IV1").End(xlToLeft).Column
    For MY_ROWS = 1 To Cells(65536, MY_COLS).End(xlUp).Row
    If MY_STRING = "" Then
        MY_STRING = Cells(MY_ROWS, MY_COLS)
    Else
        MY_STRING = MY_STRING & "," & Cells(MY_ROWS, MY_COLS)
    End If
       Next MY_ROWS
    Cells(MY_ROWS, MY_COLS).Value = MY_STRING
    MY_STRING = ""
Next MY_COLS
End Sub
 

Forum statistics

Threads
1,141,167
Messages
5,704,674
Members
421,360
Latest member
AJPlant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top