#1   Report Post  
jose vargas
 
Posts: n/a
Default column list

can someone help? i need to export a list to a word-
wrapped with commas text document

My spreadsheet has 500 such numbers:

Column A
4567
45676
23434
442344

desired outpu:
4567,45676,23434,442344

Thanks
  #2   Report Post  
Peter Rooney
 
Posts: n/a
Default

Hi, Jose!

Try this - you'll need to select the cells in your worksheet first, and
obviously subsitute an appropriate path and filename in the save as line

Hope this helps

Pete

Sub ListToTest()
Dim ListCounter As Integer
Dim ConCatString As String
ConCatString = ""
For ListCounter = 1 To Selection.Cells.Count
ConCatString = ConCatString & CStr(Selection.Cells(ListCounter)) & ","
Next ListCounter
Workbooks.Add
Range("A1").Formula = ConCatString
ActiveWorkbook.SaveAs Filename:="D:\Pete's Operations\VBA\Example.csv", _
FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Close
End Sub


"jose vargas" wrote:

can someone help? i need to export a list to a word-
wrapped with commas text document

My spreadsheet has 500 such numbers:

Column A
4567
45676
23434
442344

desired outpu:
4567,45676,23434,442344

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going from column to comma separated list... jmboggiano Excel Discussion (Misc queries) 1 March 10th 05 04:30 PM
how can I list items in a column with totals? andy Excel Discussion (Misc queries) 4 February 22nd 05 08:30 PM
Insert column entries from a master list RichLorn Excel Worksheet Functions 1 October 28th 04 10:37 PM
Insert column entries from a master list RichLorn Excel Worksheet Functions 0 October 28th 04 08:59 PM
Insert column entries from a master list RichLorn Excel Worksheet Functions 0 October 28th 04 08:57 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"