A User Defined Function To Check If A Sheet Exists Within The Current Workbook


  This is a simple VBA function that will return true if the current workbook contains a sheet with the exact name passed through the function and returns false otherwise. This function is not case sensitive so Sheet1 and SHEET1 are considered to be the same (sheet names in Excel are not case sensitive). Here the VBA is formatted as a user defined function.     With this code we can use =WorksheetExists(B3) to test any text string to see if it exists as a sheet name in the current workbook.

How To Check If A Worksheet Exists Using VBA - 72