FindSheet

Finds a sheet in a workbook, if no workbook name passed, it will use ThisWorkbook.
Returns true if found, or false if not

CodeFunctionName
What is this?

Public

Tested

Original Work
Function FindSheet(SheetName, Optional ThisWB = "") As Boolean
' Searches for a sheet in a workbook
' Can also be used as User-Defined-Function
If ThisWB = "" Then ThisWB = ThisWorkbook.Name
FindSheet = False
If SheetName = "" Then Exit Function
For I = 1 To Workbooks(ThisWB).Sheets.Count
If UCase(SheetName) = UCase(Workbooks(ThisWB).Sheets(I).Name) Then
FindSheet = True
Exit Function
End If
Next I
End Function

SheetName, Optional ThisWB

Views 4,738

Downloads 1,482

CodeID
DB ID