我想通过点击一个按钮来取消隐藏一个工作表,然后再点击一次来取消隐藏另一个。
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = False Then
invi = invi + 1
End If
Next
Do Until invi = 1:
ThisWorkbook.Worksheets.Visible = True
invi = invi + 1
Loop
End Sub
每次运行时取消第一个隐藏:
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = False Then
ws.Visible = True
Exit For
End If
Next