Hi all,
I am using a macro to save sheet as *txt file. It works fine, but it changes decimal separators - from comma to dots. How to make sure it will keep commas?
I already checked my advanced settings:
Here is the input:
And here is how it looks after *txt file is saved
Here is a code I am using:
I am using a macro to save sheet as *txt file. It works fine, but it changes decimal separators - from comma to dots. How to make sure it will keep commas?
I already checked my advanced settings:
Here is the input:
And here is how it looks after *txt file is saved
Here is a code I am using:
VBA Code:
Sub SaveTheFileText()
Dim ans As Long
Dim sSaveAsFilePath As String
On Error GoTo ErrHandler:
sSaveAsFilePath = "C:\AAA\ZVOL 9F LSMW.txt"
If Dir(sSaveAsFilePath) <> "" Then
ans = MsgBox("File " & sSaveAsFilePath & " exists. Overwrite?", vbYesNo + vbExclamation)
If ans <> vbYes Then
Exit Sub
Else
Kill sSaveAsFilePath
End If
End If
Worksheets("Pricelist").Copy '//Copy sheet to new workbook
ActiveWorkbook.SaveAs sSaveAsFilePath, xlTextWindows '//Save as text (tab delimited) file
'If ActiveWorkbook.Name <> ThisWorkbook.Name Then '//Double sure we don't close this workbook
'ActiveWorkbook.Close False
'End If
My_Exit:
Exit Sub
ErrHandler:
MsgBox Err.Description
Resume My_Exit
End Sub