exporting in csv format

  • Thread starter Thread starter R. sigfusson
  • Start date Start date
R

R. sigfusson

When using csv output format, the seperator is semi comma
instead of comma. How is it possible to have comma
seperator?
 
R.

It's a windows thing (couldn't tell you in others but...) in 98
Start -> Control Panel -> Regional Settings
Under the number tab you'll see
List Separator, change it to a "," instead of ";"

change will affect ALL programs!

If that doesn't suit you, a macro might help

Sub ExportCSV()
Dim fs, f
OutFile = Application.GetSaveAsFilename(FileFilter:="CSV (Comma delimited)(*.csv), *.csv")
If OutFile = False Then Exit Sub
ActiveSheet.UsedRange.Select
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(OutFile, 2, -2)
For Rcount = 1 To Selection.Rows.Count
For CCount = 1 To Selection.Columns.Count
Outline = CStr(Selection.Cells(Rcount, CCount).Text)
f.Write Outline
If CCount <> Selection.Columns.Count Then f.Write ", "
Next
f.Write vbCrLf
Next
f.Close
Set f = Nothing
Set fs = Nothing
End Sub

David McRitchie has a good site if you are unfamiliar with macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Dan E
 

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

Back
Top