Sub xuan()Dim sht As WorksheetFor Each sht In ActiveWindow.SelectedSheets If sht.Name = "Sheet4" Then MsgBox "选中了": Exit SubNext shtMsgBox "没选中"Set sht = NothingEnd Sub