Answers for "excel vba export sheet as a csv without losing focus of my current workbook"

VBA
3

excel vba export sheet as a csv without losing focus of my current workbook

'VBA function to save current worksheet as a CSV file without losing
'focus. The CSV file is saved in the same directory as the current
'workbook. The Local Separator is utilized:

Sub SaveSheetAsCSV()
  With ActiveSheet
    .Copy
     ActiveWorkbook.SaveAs Left(.Parent.Name, InStrRev(.Parent.Name, ".")) & .Name & ".csv", xlCSV, Local:=True
     ActiveWorkbook.Close False
    .Activate
  End With
End Sub
Posted by: Guest on May-01-2020

Code answers related to "excel vba export sheet as a csv without losing focus of my current workbook"

Code answers related to "VBA"

Browse Popular Code Answers by Language