问题
Maybe you guys could help me because I'm stumped. Here are some pictures to help illustrate my problem:
As you can see, D1 is "referencing" B1. However, because I'm using the INDIRECT function, the actual reference is C1 and the following occurs:
The blue reference box is on C1 and not B1. Is there any way to change the blue box so that it surrounds the actual cell being referenced (B1) without actually changing which cell is referenced by the INDIRECT function (C1)?
Also, this is just an example to illustrate my problem. I don't think it's wise to post my actual sheet because I'm in a research lab. Rest assured, the INDIRECT function is necessary.
回答1:
You technically could use conditional formatting, but the problem is you would need to add a conditional formatting formula for each one of your offset formulas. If you are staying in the same row and there a multiple offsets this might be ok, but if your offsets are being called from all over the place and can it will become unruly.
Select your reference area in this case A1:C1 and ensure A1 is your active cell within your selection. Go into conditional formatting and make a new formula based rule. In the line for the formula enter the following:
=A1=OFFSET(INDIRECT($C1),0,1)
This assumes you are staying in the same row, if not then use $C$1.
now the kicker is you just have to repeat that process for every offset function you want to check. The reason I left it as $C1 was in case the offset function was repeated row after row.
Proof of concept
来源:https://stackoverflow.com/questions/37489178/change-the-reference-of-a-cell-in-excel