如何记录副本保存到范围内的位置
How to log where the copy has saved into a range
我想登录到保存工作簿副本的单元格。
到目前为止我已经保存了它,但不知道如何记录它
Sub CreateCopy()
Dim specialPath As String
Dim NameOfWorkbook As String
Dim FileName As String
specialPath = DownloadF & Range("HomeDB")
'FileCopy Application.ThisWorkbook.FullName, specialPath
NameOfWorkbook = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
ActiveWorkbook.SaveCopyAs FileName:=ThisWorkbook.path & "R" & ".xlsm"
End Sub
我希望它暂时保存到范围调用测试中。
谢谢
此子程序会将工作簿的路径保存到指定范围 "test"。这是 Mac 版本的代码,因此您可能需要调整文件路径定义。
Sub log()
Dim r As Range
Set r = ActiveSheet.Range("A1")
With ThisWorkbook
.Names.Add "test", r
r = .Path & "/R" & ".xlsm"
End With
End Sub
我想登录到保存工作簿副本的单元格。
到目前为止我已经保存了它,但不知道如何记录它
Sub CreateCopy()
Dim specialPath As String
Dim NameOfWorkbook As String
Dim FileName As String
specialPath = DownloadF & Range("HomeDB")
'FileCopy Application.ThisWorkbook.FullName, specialPath
NameOfWorkbook = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
ActiveWorkbook.SaveCopyAs FileName:=ThisWorkbook.path & "R" & ".xlsm"
End Sub
我希望它暂时保存到范围调用测试中。
谢谢
此子程序会将工作簿的路径保存到指定范围 "test"。这是 Mac 版本的代码,因此您可能需要调整文件路径定义。
Sub log()
Dim r As Range
Set r = ActiveSheet.Range("A1")
With ThisWorkbook
.Names.Add "test", r
r = .Path & "/R" & ".xlsm"
End With
End Sub