Otherwise, it goes through all of them and returns false. Also, it is case-insensitive.
Private Function WorksheetExists(wsName As String) As Boolean Dim ws As Worksheet Dim ret As Boolean ret = False wsName = UCase(wsName) For Each ws In ThisWorkbook.Sheets If UCase(ws.Name) = wsName Then ret = True Exit For End If Next WorksheetExists = ret End Function
No comments:
Post a Comment