这是我在这个网站上的第二篇文章,我对 VBA 比较陌生。
我今天的问题是,
如何将单元格值添加到路径字符串以指定要保存工作簿的文件夹。
Dim Path As String
Dim FileName1 As String
Dim FileName2 As String
Path = "D:\folder1\folder2\Projects\The FILES\theFILES\"FileName1"\
FileName1 = Range("B6")
FileName2 = Range("A1")
ActiveWorkbook.SaveAs Filename:=Path & FileName2 & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
Run Code Online (Sandbox Code Playgroud)
提前致谢!