Option Explicit Sub Save_CSV() Dim MyPATH As String Dim FileNAME As String MyPATH = ActiveWorkbook.

Path FileNAME = ActiveWorkbook.Name FileNAME = Left(FileNAME, Len(FileNAME) - 4) ' REMOVE XLS EXTENSION FileNAME = FileNAME & ".csv" ' ADD CSV EXTENSION Application.DisplayAlerts = False ' REMOVE DISPLAY MESSAGE: PREVIOUS FILE W ILL BE ERASED ActiveWorkbook.SaveAs FileNAME:= _ MyPATH & "\" & FileNAME, FileFormat:=xlCSV, _ CreateBackup:=False ActiveWindow.Close Application.DisplayAlerts = True ' RESTAURE DISPLAY MESSAGE End Sub

Sign up to vote on this title
UsefulNot useful