Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Excel: Prüfen ob ein Worksheet vorhanden ist

29.03.2019 (👁260)

Excel: Prüfen ob ein Worksheet vorhanden ist

Folgende kleine Funktion prüft, ob ein Excel Arbeitsblatt vorhanden ist:

Option Explicit

 

 

Public Function Worksheet_exits(ByVal wb As Workbook, ByVal sSheetname As String) As Boolean

    '------------< Worksheet_exits() >-------------------

    Dim bReturn As Boolean

    bReturn = False

    sSheetname = LCase(sSheetname)

   

    '---< @Loop: Worksheets >---

    Dim ws As Worksheet

    For Each ws In wb.Worksheets

        Dim sName As String

        sName = LCase(ws.Name)

        If sName = sSheetname Then

            bReturn = True

            Exit For

        End If

    Next

    '---</ @Loop: Worksheets >---

   

    '< output >

    Worksheet_exits = bReturn

    '</ output >

    '------------</ Worksheet_exits() >-------------------

End Function