Why? Because it is possible that the text box isn't really part of the chart, but is part of the worksheet. Text boxes on embedded charts are a different story. If you want to change what is contained in a message box, all you need to do is set the Text property of the TextRange object. Whatever is in each text box is then displayed in a message box. This macro steps through each chart sheet and then through each text box on each chart sheet. If you place a text box on an actual chart sheet, then it can be accessed in the following manner: Embedded charts, on the other hand, are represented by a Chart object that belongs to the ChartObjects collection which, in turn, belongs to a worksheet object. Chart sheets are represented by a Chart object and belong to the Charts collection. There are two types of charts that can be contained in a workbook: a chart sheet and an embedded chart. Whatever you type should appear immediately in the text box.īefore some potential macro-related answers can be provided, you'll need a bit of background concerning Excel's object model, which is accessible through VBA. Now, type something into the associated cell. The address for the cell should appear in the Formula bar. You could also, if you prefer, delete whatever is in the Formula bar and, with the Formula bar active, click on the cell you want linked. This ties the contents of the text box to whatever is in cell C15. You can do this by entering it like this: Then, in the Formula bar, enter a cell reference. The familiar handles should appear around the outside of the text box.
![excel chart text box formula excel chart text box formula](https://www.got-it.ai/solutions/excel-chat/wp-content/uploads/2019/05/Figure-1.-Final-result-How-to-edit-legend.png)
![excel chart text box formula excel chart text box formula](https://bettersolutions.com/excel/charts/dataseries-seriesformula.png)
Excel chart text box formula how to#
Here's how to achieve this technique: Select the text box you want to associate with a cell by clicking on it a single time. That cell could contain a text value, a numeric value, a date, or a formula-it doesn't really matter. This means that you could make each of your text boxes "dynamic" so that all you need to do is change what is in the associated cell. You can, if you'd like, tie what is shown in a text box to the contents of a cell. This can, of course, be done with a macro, but you should understand that there is a way to do it without a macro. Don would like to change all of the text in these chart text boxes with a macro but doesn't know the proper technique to perform the task. Each chart contains two text boxes with dates of the current data and dates that the chart was updated.