Delete Current Sheet If No Dependents
Posted on 2015-02-22
Frequently I need to delete sheets in a workbook and in order to avoid #REF errors, I normally do a quick FIND of the name of the current worksheet in the entire workbook, if the name is not found, in named ranges or hidden sheets, then it's safe to delete.
I would like a VBA code that will do the following:
Find the name of the current sheet in the entire workbook, including in named ranges and in hidden sheets
If name not found, then this means that no other sheets depend on it, so delete current sheet
Any help with this will be greatly appreciated.