.Copy之后引用新表

时间:2019-05-02 18:17:36

标签: excel vba

将新工作表复制为新工作簿后,如何引用它。

curl -X POST \
  https://example.com/job/myteam.myrepo.mybranch/build \
  -H 'Authorization: Basic myauth' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json'

是否可以定义名称?有点像

Dim MainWb As Workbook: Set MainWb = ThisWorkbook
Dim SheetToCopy As Worksheet: Set SheetToCopy = MainWb.ActiveSheet

SheetToCopy.Copy

1 个答案:

答案 0 :(得分:0)

当您复制工作表时,它会变成ActiveSheet,因此您可以参考。

Dim MainWb As Workbook: Set MainWb = ThisWorkbook
Dim SheetToCopy As Worksheet: Set SheetToCopy = MainWb.ActiveSheet
Dim CopiedSheet As Worksheet

SheetToCopy.Copy 

Set CopiedSheet = ActiveWorkbook.ActiveSheet