【发布时间】:2026-02-16 13:40:01
【问题描述】:
我想遍历 Excel Tab >>> 和 <<< Tab 中的特定工作表并插入新行并粘贴特殊值。
以下代码允许循环遍历所有工作表,但我不确定如何在特定工作表之间循环 - 即 For Each 选项卡仅在两个选项卡之间,不包括 - Tab >>> 和 <<< Tab。
Sub WorksheetLoop2()
' Declare Current as a worksheet object variable.
Dim Current As Worksheet
' Loop through all of the worksheets in the active workbook.
For Each Current In Worksheets
' Insert new row here and paste special values
' This line displays the worksheet name in a message box.
MsgBox Current.Name
Next
End Sub
【问题讨论】: