Dim wkbkdestination As Workbook Dim destsheet As Worksheet For Each ThisWorkSheet In wkbkorigin.Worksheets \'this throws subscript out of range if there is not
In case anyone wants to avoid VBA and test if a worksheet exists purely within a cell formula, it is possible using the ISREF and INDIRECT functions:
ISREF
INDIRECT
=ISREF(INDIRECT("SheetName!A1"))
This will return TRUE if the workbook contains a sheet called SheetName and FALSE otherwise.
TRUE
SheetName
FALSE