Sub 判斷某個工作表是否被選中1()
Dim sh As Worksheet, i As Byte
For Each sh In Application.ActiveWindow.SelectedSheets
If sh.Name = "E" Then
MsgBox "名稱為E的工作表被選中。"
Else
i = i + 1
End If
Next
If i = Application.ActiveWindow.SelectedSheets.Count Then MsgBox "名稱為E的工作表未被選中。"
End Sub
Sub 判斷某個工作表是否被選中2()
Dim d As Object, sh As Worksheet
Set d = CreateObject("scripting.dictionary")
For Each sh In Application.ActiveWindow.SelectedSheets
d.Add sh.Name, ""
Next
If d.exists("E") Then
MsgBox "名稱為E的工作表被選中。"
Else
MsgBox "名稱為E的工作表未被選中。"
End If
Set d = Nothing
End Sub
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報。