Question

In an excel cell, I've placed a simple formula

=C4

The cell typically displays the value of cell C4, but instead I want to see the linked cell ID instead, which in this case is "C4".

Is there a formula to show me this? like:

=SHOWCELL(C4)

The reason I need this instead of simply typing the value of "C4" into the cell, is so Excel will maintain the link to the correct cell even if rows are inserted/deleted, AND show me which cell is linked.

Was it helpful?

Solution

You should be able to use the Cell function.

In Excel, the Cell function can be used to retrieve information about a cell. This can include contents, formatting, size, etc.

=Cell("address", C4)

This displays $C$4.

When inserting a row before C4, it is changed to $C$5.


In case you do not want the $ signs, one way would be the Substitute function:

=Substitute( Cell("address", C4), "$", "" )

OTHER TIPS

You can create your own User Defined Function to achieve this. I call it "CellReference".

Usage:

=CellReference(B6) 

displays "B6"

To use it, launch VBA, insert a module, and then copy the below into the module:

Function CellReference(cell As range) As String

     CellReference = cell.Address(0, 0, xlA1)

End Function
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top