我有这个工作,除了我需要生成的文件特别是'windows逗号分隔CSV'文件。任何想法如何指定这个?
Sub asdf()
Dim ws As Worksheet, newWb As Workbook
Application.ScreenUpdating = False
For Each ws In Sheets(Array("sheet1", "sheet2"))
ws.Copy
Set newWb = ActiveWorkbook
With newWb
.SaveAs ws.Name & ".csv", xlCSV
.Close (False)
End With
Next ws
Application.ScreenUpdating = True
End Sub
答案 0 :(得分:3)
应该像将FileFormat
指定为CSVWindows
.SaveAs ws.Name & ".csv", xlCSVWindows