Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save .csv file. English (American) Settings
I'm using Excel 2000. I have a problem when exporting an excel sheet t
a .csv file with a macro. I want the decimals to be separated by commas, not by point (English Settings). Someone in this forum gave me the code to solv this problem using a macro. The problem I have now is .. I don't know how to insert that cod in my macro!! This is the code: Sub OutputActiveSheetAsCSVFile() Dim SrcRg As Range Dim CurrRow As Range Dim CurrCell As Range Dim CurrTextStr As String Dim ListSep As String Dim FName As Variant FName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv") If FName < False Then ListSep = Application.International(xlListSeparator) If Selection.Cells.Count 1 Then Set SrcRg = Selection Else Set SrcRg = ActiveSheet.UsedRange End If Open FName For Output As #1 For Each CurrRow In SrcRg.Rows CurrTextStr = "" For Each CurrCell In CurrRow.Cells CurrTextStr = CurrTextStr & CurrCell.Value & ListSep Next While Right(CurrTextStr, 1) = ListSep CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1) Wend Print #1, CurrTextStr Next Close #1 End If End Sub I want to use a fix directory to save the file. I also have the nam of the file in a string variable called varText. The selection is fixed too (Columns("A:M").Select) , so I think wha I need must be very simple. Could anybody help me? Thanks a lot. Regards -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
.pdf save as settings | Excel Discussion (Misc queries) | |||
Using english and non-English Excel commands simultaneously in anon-English installation | Excel Worksheet Functions | |||
associate / save printer selection and settings with file | Excel Discussion (Misc queries) | |||
Does Not Save Settings | Excel Discussion (Misc queries) | |||
save settings for reinstall later | Setting up and Configuration of Excel |