I am the author of an application that before opening an Excel workbook, deletes and recreates some worksheets, like, for example "Sheet1" in the example below.
Other worksheets (say Sheet2) in the same workbook may have formulas that refer to the replaced worksheet, like this:
=IF('Sheet1'!A9="","",'Sheet1'!A9)
Unfortunately, the reference in the above formula to Sheet1 is broken when the sheet is replaced, becoming
=IF(#Ref!A9="","",#REF!A9)
Can anyone think of a way to code this formula so it doesn't fail? It could, for example, get the name of the worksheet from a hidden cell in Sheet2 or something?
I just don't know enough about Excel formulas to know what the possibilities are.
TIA