測(cè)試或檢查是否存在工作表Dim wkbkdestination As WorkbookDim destsheet As WorksheetFor 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基本上,我循環(huán)遍歷原始工作簿中的所有工作表,然后設(shè)置destsheet在目標(biāo)工作簿中,指向與原版工作簿中當(dāng)前迭代的工作表名稱相同的工作表。我怎樣才能測(cè)試那張紙是否存在?類似于:If wkbkdestination.Worksheets(ThisWorkSheet.Name) Then
測(cè)試或檢查是否存在工作表
繁華開(kāi)滿天機(jī)
2019-06-18 17:03:58