Hi recently i tried by using one macro to save a particular sheet in CSV by asking the user the path and the name of the file that I want to save using Dialog box (Save As)
This is the code :
Public Sub Save_sheet_CSV()
Dim FileName As String
FileName = Application.GetSaveAsFilename(FileFilter:="Excel Files (*.csv), *.csv")
If FileName = "False" Then
MsgBox "No filename specified!", vbExclamation
Else
Sheets("DATA_SHEET").Select
ActiveSheet.Copy
Call Formatage_Export
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=FileName, FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
End If
End Sub
The specified sheet is correctly saved but, when i open the CSV file all the information are on the first column.
Is possible to fix that at the same time that the sheet is saving.
This is the code :
Public Sub Save_sheet_CSV()
Dim FileName As String
FileName = Application.GetSaveAsFilename(FileFilter:="Excel Files (*.csv), *.csv")
If FileName = "False" Then
MsgBox "No filename specified!", vbExclamation
Else
Sheets("DATA_SHEET").Select
ActiveSheet.Copy
Call Formatage_Export
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=FileName, FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
End If
End Sub
The specified sheet is correctly saved but, when i open the CSV file all the information are on the first column.
Is possible to fix that at the same time that the sheet is saving.