0
Thanks

A few words of thanks would be greatly appreciated.

Excel - Text box linked to cell value

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.


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.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team

Published by . Latest update on by aakai1056.

This document, titled "Excel - Text box linked to cell value," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments