2011年6月28日火曜日

Excel シートの存在チェック

Public Function sheetExist(name As String)
   
    Dim ws As Worksheet
    Dim flag As Boolean
   
    For Each ws In Worksheets
        If ws.name = name Then
            flag = True
            Exit For
        End If
    Next ws
    sheetExist = flag
End Function

0 件のコメント:

コメントを投稿