Forum Discussion
need help with saving a sheet to a new workbook csv
i found this code
nomFichier = ActiveWorkbook.Path & "\" & "_" & ActiveSheet.name & Format(Now, "_yyyymmdd")
'ActiveSheet.Copy
'ActiveWorkbook.SaveAs nomFichier
Application.DisplayAlerts = False
wbNew.SaveAs nomFichier & ".csv", xlCSVUTF8 'new way
Application.DisplayAlerts = True
it almost does what i need (i mean it grabs my sheet and saves it into csv format
but for some reason it also renames my sheet in my current workbook and i do not want that 😞
all i need it to do is to grab my sheet and save it to a new workbook in CSV format utf-8
thank you for any help
No,
It copies the active sheet to a new workbook.This new workbook is now the active workbook.
This will be saved as a .csv file and then closed. You are left with the original, unchanged workbook.
4 Replies
nomFichier = ActiveWorkbook.Path & "\" & "_" & ActiveSheet.Name & Format(Now, "_yyyymmdd") ActiveSheet.Copy Application.DisplayAlerts = False ActiveWorkbook.SaveAs nomFichier & ".csv", xlCSVUTF8 ActiveWorkbook.Close SaveChanges:=False Application.DisplayAlerts = True- Slyfox6915Copper Contributorwill that just close my workbook ?
No,
It copies the active sheet to a new workbook.This new workbook is now the active workbook.
This will be saved as a .csv file and then closed. You are left with the original, unchanged workbook.