Created
March 16, 2012 05:27
-
-
Save nobrinskii/2048643 to your computer and use it in GitHub Desktop.
[vba/excel] 指定された名前のワークシートが存在するかの確認
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'------------------------------------------------------------------------------- | |
'指定された名前のワークシートが存在するかの確認 | |
'------------------------------------------------------------------------------- | |
'【引数】対象ブック、検索するシート名 | |
'【戻り値】シートの存在の有無 | |
'【備考】 | |
Private Function HasSheet(wbTarget As Workbook, strSheetName As String) As Boolean | |
Dim sheet As Worksheet | |
Dim blnFlag As Boolean | |
For Each sheet In wbTarget.Worksheets | |
If sheet.Name = strSheetName Then | |
blnFlag = True | |
Exit For | |
End If | |
Next sheet | |
HasSheet = blnFlag | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment