ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   dynamic cell reference within a text string (https://www.excelbanter.com/excel-worksheet-functions/36799-dynamic-cell-reference-within-text-string.html)

gvm

dynamic cell reference within a text string
 
The documentation of my model includes a text string typed into a cell to the
effect "alter the conversion factor, ie cell D23, to etc etc". My problem is
that as the model develops, the cell containing the conversion factor
changes, ie the reference to D23 becomes wrong. Is there a way of referring
to D23 in the aforementioned text string so that the cell reference changes
in sync with changes to the cell containing conversion factor?


Aladin Akyurek

="alter the conversion factor, ie cell "&D23&", to etc etc"

gvm wrote:
The documentation of my model includes a text string typed into a cell to the
effect "alter the conversion factor, ie cell D23, to etc etc". My problem is
that as the model develops, the cell containing the conversion factor
changes, ie the reference to D23 becomes wrong. Is there a way of referring
to D23 in the aforementioned text string so that the cell reference changes
in sync with changes to the cell containing conversion factor?


gvm

Thanks Aladin,
but unless I typed it in incorrectly, the effect of your suggestion was to
insert the value contained in D23 which is not what I want. I want the cell
reference itself (D23) inserted, and for this reference to change if the cell
location is changed.

is this possible?
regards,
Greg

Dave Peterson

Aladin showed you a way to return the value that is in D23.

You could use:

="alter the conversion factor, ie cell " & cell("address",D23) & ", to etc etc"

One thing you may want to do--just to make it easier for you when you come back
to it in a few months--is to give that cell a nice name.

Select D23 (or whereever it is)
insert|Name|Define
Names in Workbook
ConvFact

="alter the conversion factor, ie cell " & cell("address",convfact) & ", to..."

=======
If you want to see D23 instead of $D$23, use this

= "xxx" & SUBSTITUTE(CELL("address",convfact),"$","") & "yyyy"



gvm wrote:

Thanks Aladin,
but unless I typed it in incorrectly, the effect of your suggestion was to
insert the value contained in D23 which is not what I want. I want the cell
reference itself (D23) inserted, and for this reference to change if the cell
location is changed.

is this possible?
regards,
Greg


--

Dave Peterson

gvm

That is exactly what I needed and more, thank you Dave




All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com