Do you think this is probably the 'refresh' problem referred to or may be something else?
Hi Peter
Sorry for not answering sooner but I was away from the board for Christmas.
Remark: I will assume the solution in post #8 of the thread in the link you posted, where you use the SelectChange event procedure to force recalculation.
I analysed the thread in the link you posted and in my opinion this is another problem.
1 -
The formula that you have in your name is not marked to be recalculated when you change the colour of a cell, independently of how you reference the cell.
To check this, test the name in Sheet1. If you change the Name reference from
to
it will still not work althoug you are now using the sheet name in the cell reference.
My conclusion is that this problem with the recalculation of the formula has not to do with the notation you use. It's simply that changing a cell does not cause the formula to be marked as needing to be recalculated.
2 - Why did it start to work OK when you changed the name reference?
You changed the name reference to:
Code:
=GET.CELL(63,OFFSET(INDIRECT("RC",FALSE),0,-1))
I believe that now it works OK because you are using the function Indirect(). Indirect forces recalculation of a formula any time a cell is checked for calculation.
To check this change the name reference to:
Code:
=GET.CELL(63,!A2)+ISNUMBER(INDIRECT(""))
INDIRECT("") returns error and so ISNUMBER(INDIRECT("")) is always false. This means that you are adding 0 and so the value remains the same.
Now, however, it will refresh OK. When you use the Columns("B").Calculate the Indirect() in the formula will force the name to be recalculated. And you are still using the implicit "active sheet" cell reference.
Remark: Another way to solve the problem would be to keep the original name reference, but change:
to
Code:
Application.CalculateFull
This would force the formula to be recalculated, but at the expense of recalculating also all other formulas which is very inefficient.