Macros de excel a txt delimitado por comas

Hola quiero un Macros para pasar de excel a txt... En el mismo lugar de origen del archivo original.. Pero también que este separado con comas y sin ("") adjunto un ejemplo

0.00 -33.081 3150.015 resultado 0,-33.081,3150.015
0.00 -33.081 3150.015 0,-33.081,3150.015
0.00 -28.751 3147.515 0,-28.751,3147.515

Este es el macros que actualmente uso

Private Sub EXPORT_reporte_Click()
'export activesheet as TXT file
Dim myPath As String, myFile As String
myPath = ThisWorkbook.Path & "\"
myFile = "REPORTE.txt"
Dim WB As Workbook, newWB As Workbook
Set WB = ThisWorkbook
Application.ScreenUpdating = False
Set newWB = Workbooks.Add
WB.ActiveSheet.UsedRange.Copy newWB.Sheets(1).Range("A1")
With newWB
Application.DisplayAlerts = False
.SaveAs FileName:=myPath & myFile, FileFormat:=xlText
.Close True
Application.DisplayAlerts = True
End With
WB.Save
Application.ScreenUpdating = True
MsgBox "Se ha Exportado Correctamente", , "REPORTE"
End Sub

1 respuesta

Respuesta
2

Hice una prueba y me funcionó bien.

Cambia xlText por xlCSV

Prueba y me comentas

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas