Ask a question »

Excel - Text box linked to cell value

July 2015

A text box placed in a chart can be linked to a cell value in another sheet in Microsoft Excel. The source text string can be formatted according to the requirements, in this case, percentage and reflected in the text box of the chart. The Visual Basic FormatPercent function can be used to achieve the result without using an if-then-else or for loop. A basic knowledge of Visual Basic scripting may prove to be useful to implement the FormatPercent function in the Excel office software worksheet. Unless specified, the FormatPercent Visual Basic function gives an output approximated to two decimal places.

[Excel] Text box linked to cell value




Issue


I have a text box placed in a chart that links to another sheet/cell for its content. The value is a percentage. I can format the source text using conditional format, but the formatting doesn't carry forward into the text box. Is there a way to script/macro or use if/then for the value of a text box to change the font color? The text box is linked simply with "=Data!$J$7"? Any help would be greatly appreciated!

Solution


You can try this:
FormatPercent(Data!$J$7,0)

Note that


Thanks to andy for this tip on the forum.
For unlimited offline reading, you can download this article for free in PDF format:
Excel-text-box-linked-to-cell-value.pdf

See also

In the same category

Published by aakai1056.
This document entitled « Excel - Text box linked to cell value » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.