预期行动:
- 将 123.csv 中的 CA:CF 列复制并粘贴到 123a.csv
有人可以帮忙将“SaveAs”原始工作簿名称附加在附加的“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, _