VBA常用自定义函数(2) - 检查工作簿是否存在


'检查工作表是否存在
Public Function SheetExist(strSearchFor As String) As Boolean
    Dim InterimSheet As Object
    SheetExist = False
    For Each InterimSheet In ActiveWorkbook.Worksheets
        If InterimSheet.Name = strSearchFor Then
            SheetExist = True
            Exit Function
        End If
    Next InterimSheet
End Function
posted @ 2020-06-05 11:34  何未生  阅读(408)  评论(0编辑  收藏  举报