Referencing linked sources

lax4673

New Member
Joined
Jun 27, 2011
Messages
14
Hi, Don't have any experience in Excel, but was looking for a way that I would be able to display the reference/coordinates (from linked data) of the cells in one column into another.

In example, in one column I have:
5
14
16
43

which has been pulled from another workbook

On another column, I would like the cell reference to be displayed (coming from the linked workbook)

B4 (where 5 came from)
C5 (where 14 came from)...

Is there an easy way to accomplish this? Thank you!!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thank you, Glenn, but when I try to use that formula, I am given "FALSE" as my value in C1.

Is there an easier way to just get the location of another cell and then I could format it to be what I wanted in yet another cell?

In example, if the data I pull into cell A1 of Sheet 1 is "1234" which came from cell A1 of Sheet 2, would I be able to get cell A2 of Sheet 1 to display something like "Sheet2/A1" to tell me where I pulled my data in A1?

Then, would I also be able to format the data from this cell in A3 to be "S2/A1" or another abbreviated version of the actual file path?

Thank you~

You can retrieve the formula of a cell, like this:

http://www.mrexcel.com/forum/showthread.php?t=560414

... you could then manipulate that result as you wish.
 
Upvote 0
Have you written any VBA user defined functions before?
 
Upvote 0
No, but I ended up finding a macro online:

Function CellFormula(c)
CellFormula = c.Formula
End Function

which allows me to reference where I am pulling my data from.

The only problem I have now is that instead of the reference reading "='2. Data'!B3," I would like the reference to simply be '2. B3'. Do you know of any way I could do this within the macro? Because in some cases I will be referencing more than one cell (i.e. 2.B3+2.B5), and cells with different digit lengths (B3 vs. B33), I cannot simply use a left/right formula.

Thank you!!
 
Upvote 0
It depends on how you want to manipulate the references ... it looks like you want to remove the "=" and remove the "!" and remove the " Data" parts and remove single quotes. Does that cover what you want to do, exactly? If so, have a look at the Replace function in VBA, like:
Code:
Function CellFormula(c)
CellFormula = c.Formula
CellFormula = Replace(Replace(Replace(Replace(CellFormula, "=", ""), " Data", ""), "'", ""), "!", "")
End Function
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top