遍历for each 来比对也是可以的
或则
Sub iexist()
On Error Resume Next
If Sheets(sname) Is Nothing Then
MsgBox "工作表不存在"
Else
MsgBox "工作表存在"
End If
End Sub
sName = Worksheets("sheet2").Cells(1, n).Value
for i=1 to ThisWorkbook.Worksheets.count
if ThisWorkbook.Worksheets(i).name=sname then exit for
next
If i>ThisWorkbook.Worksheets.count Then'不存在