0

ok so this is a short peace in a big workbook... All i am trying to do is tell it a certain place to save.

ActiveWorkbook.SaveCopyAs _
    FileName:=ActiveWorkbook.Path "\OLD " & Range("D1").Value & ".XLSM"

This does exactly as it is supposed to however, i want to say basically "activeworkbook.path" plus give it one further step and designate a folder called "old" that it will go to.

in essence it would look like this

\documents\test\my-file.xlsm

to this

\documents\test\OLD\my-file.xlsm

any hints?

4

1 回答 1

2

您在 中有一个空格"\OLD ",并且您不会关闭\OLD成为一个文件夹。

这条线应该看起来像

ActiveWorkbook.SaveCopyAs _
    FileName:=ActiveWorkbook.Path & "\OLD\" & Range("D1").Value & ".XLSM"

我也会强烈考虑用你的工作表来证明你的资格Range("D1")

Dim fileNameRng as range
Set fileNameRng = thisworkbook.worksheets("Sheet1").Range("D1")

ActiveWorkbook.SaveCopyAs _
    FileName:=ActiveWorkbook.Path & "\OLD\" & fileNameRng.Value & ".XLSM"
于 2018-11-12T03:40:04.777 回答