預期行動:
- 將 CA:CF 欄位從 123.csv 複製並貼上到 123a.csv
任何人都可以協助“另存為”原始工作簿名稱並附加“a”嗎?
謝謝。
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+d
'
Columns("CA:CF").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ChDir "A:\test\Exported files"
ActiveWorkbook.SaveAs Filename:= _
"A:\test\Exported files\123.csv", FileFormat:=xlCSV, _
CreateBackup:=False
ActiveWindow.Close
ActiveWindow.Close
End Sub
答案1
請編輯以下程式碼:
ActiveWorkbook.SaveAs Filename:= _
"A:\test\Exported files\123.csv", FileFormat:=xlCSV, _
到:
ActiveWorkbook.SaveAs Filename:= _
"A:\test\Exported files\123a.csv", FileFormat:=xlCSV, _