增加一个新sheet 的时候,怎么判断是否存在
各位高人怎么用程序判断是工作簿中存在的工作页,在增加新页的时候,,
帮帮忙
yygy 2003-8-26 19:33
Dim WORK As Worksheet
Bool = False
ss="新页名称"
For Each w In ThisWorkbook.Worksheets
If w.Name = ss Then
Bool = True
Exit For
End If
Next w
If Bool = False Then
Set WORK = ThisWorkbook.Worksheets.Add
WORK.Name = ss
End If
Bool = False
ss="新页名称"
For Each w In ThisWorkbook.Worksheets
If w.Name = ss Then
Bool = True
Exit For
End If
Next w
If Bool = False Then
Set WORK = ThisWorkbook.Worksheets.Add
WORK.Name = ss
End If