I have a very large Excel workbook (25+ worksheets, 15+ VBA modules) for financial analysis.
I've noticed that one of the formula doesn't display a value until I manually save the workbook 2 - 3 times. Before saving it will appear as a dash (-). After saving 2 - 3 times, the values appear as expected.
I have put in a few ActiveWorkbook.Save
in my macro runs already but they don't seem to affect this case.
The formula in question is (for one cell):
=OFFSET(THIS_CELL, 0, -1)+INDEX('ExternalWorksheet'!$A$1:$CR$300,MATCH("Some Term",'ExternalWorksheet'!$A:$A,0),MATCH($B5,'ExternalWorksheet'!$1:$1,0))+INDEX('ExternalWorksheet'!$A$1:$CR$300,MATCH("Some Other Term",'ExternalWorksheet'!$A:$A,0),MATCH($B5,'ExternalWorksheet'!$1:$1,0))+INDEX('ExternalWorksheet'!$A$1:$CR$300,MATCH("Yet Another Term",'ExternalWorksheet'!$A:$A,0),MATCH($B5,'ExternalWorksheet'!$1:$1,0))-OFFSET(THIS_CELL, 0, -17)
(I know it is unruly, I didn't create it, I'm just the programmer ;) )
I am using the THIS_CELL
trick as described in this other SO post because this formula appears in multiple 'tables' in this worksheet.
My client isn't pleased about having this column appear as dashes and the columns that depend on it appearing as N/A until he saves. From what I can tell, this behaviour is related to the usage of THIS_CELL (or the OFFSET) as if I remove the OFFSET the cells update as expected. However, I can't see how to get rid of it as I have to repeat this formula over multiple 'tables' in the worksheet and have them reference the correct cells. I also can't switch to RC notation as my client doesn't like it.