Add a trailing comma

D

Dimitry

I need to add a trailing comma to a number. I have a
column with a few thousands rows in it, and I need to add
a comma to each number. I need to use this numbers in the
SQL statement, and they need to be separated by commas.
Any idea how to add a trailing comma?
 
D

Don Guillett

May not be the fastest but
Sub addtrailingcomma()
For Each c In [c2:c4000]
c.Value = c & ","
Next
End Sub
 
F

firebird96

If A1 is: 234 . . .

Then type: =(A1&",") in B1

and B1 will result in: 234,

Just copy that formula down to the bottom of your sheet and all value
will then be trailed by a comma. Once you copy the formula down to th
end you can then copy the entire B column and paste only the values i
a 3rd column.

Kevi
 
D

David McRitchie

Hi Dimitry,
Is there a problem with Save As, .CSV
save your file first then do the save as.

Another solution would be Chip Pearson's page
Exporting to Text file (found in topic.htm)
http://www.cpearson.com/excel/imptext.htm#Export

To answer the question in the manner you asked you
would add a comma to you existing format under
Format, Cells, Custom. Needless to say the comma
you introduce is probably going to be indistinguishable from
your thousands separator, or possibly indistinguishable from
your list separator..

change #,##0
to #,##0","
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top