ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   convert column data into text (https://www.excelbanter.com/excel-discussion-misc-queries/10621-convert-column-data-into-text.html)

Charlie

convert column data into text
 
I need to convert a column of data (ie 1 2 3 4) into a csv text string (ie
1,2,3,4), are there any excel functions that will help...thanks for the help

Naz

Hi

You can use this macro, adjusting it for your needs.


Sub BigConcatenate()

ColumnLenght = WorksheetFunction.Count(Range("A1:A1000")) - 1


For x = 0 To ColumnLenght

csvresult = csvresult & "," & Range("A1").Offset(x, 0)

Next x

Range("B2") = csvresult

End Sub

Simply paste it into a module in the Visual Basic Editor (VBE), pressing Alt
and F11 to get to the VBE. Then run from Excel ...Tool...Macros....Run.

Hope that helps

____________________
Naz
London


"Charlie" wrote:

I need to convert a column of data (ie 1 2 3 4) into a csv text string (ie
1,2,3,4), are there any excel functions that will help...thanks for the help



All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com