相关疑难解决方法(0)

测试或检查是否存在纸张

Dim wkbkdestination As Workbook
Dim destsheet As Worksheet

For Each ThisWorkSheet In wkbkorigin.Worksheets 
    'this throws subscript out of range if there is not a sheet in the destination 
    'workbook that has the same name as the current sheet in the origin workbook.
    Set destsheet = wkbkdestination.Worksheets(ThisWorkSheet.Name) 
Next
Run Code Online (Sandbox Code Playgroud)

基本上,我遍历原始工作簿中的所有工作表,然后destsheet在目标工作簿中将其设置为与原始工作簿中当前迭代的工作表相同的工作表.

如何测试该表是否存在?就像是:

If wkbkdestination.Worksheets(ThisWorkSheet.Name) Then 
Run Code Online (Sandbox Code Playgroud)

excel scripting vba

102
推荐指数
9
解决办法
43万
查看次数

如何检查Excel-VBA中是否存在某些工作表?

有谁知道如何使用Excel VBA检查Excel文档中是否存在某些工作表?

excel vba excel-2007

10
推荐指数
1
解决办法
8万
查看次数

标签 统计

excel ×2

vba ×2

excel-2007 ×1

scripting ×1