Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
.pdf save as settings Chass Excel Discussion (Misc queries) 1 March 19th 10 01:15 PM
Using english and non-English Excel commands simultaneously in anon-English installation Michael.Tarnowski Excel Worksheet Functions 6 March 12th 10 07:21 AM
associate / save printer selection and settings with file Jon Geiger Excel Discussion (Misc queries) 0 September 3rd 09 05:29 PM
Does Not Save Settings George Excel Discussion (Misc queries) 1 June 15th 08 03:49 PM
save settings for reinstall later Viraf NK Setting up and Configuration of Excel 0 March 1st 08 01:42 AM


All times are GMT +1. The time now is 12:28 AM.

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

About Us

"It's about Microsoft Excel"