

Select the Edit button in the Legend Entries (Series) and in the Series values select the range from the bottom Sales column:.Select Data on the chart to change y axis values
#Can you change text in excel legend how to#
To learn how to change vertical axis values, we should follow almost similar steps as in the example above:įigure 6. How to change the x axis to Store values How to Change Vertical Axis Values As a result, we changed x axis values from Years to Storesįigure 5.Select the Edit button and in the Axis label range select the range in the Store column:.Select Data on the chart to change axis values Right-click on the graph and choose Select Data:įigure 2.To change x axis values to “ Store” we should follow several steps: In the example we have a chart with Years on x-axis and Sales values on the y-axis: This step by step tutorial will assist all levels of Excel users in learning how to change axis values. This is particularly important when stepping through each shape in the worksheet, because any embedded charts on the sheet are also considered part of the Shapes collection.Īs earlier, to change the text contained in a text box, all you need to do is change the Text property of the TextRange object.In Select Data chart option we can change axis values or switch x and y axis If we want to edit axis or change the scaling in the graph we should go to Format Axis options. As in the previous macro, this one checks to make sure that the Shape object is really a text box before displaying any information about it. Then, you'll see a message box for any text boxes that are a child of the worksheet. When you run the macro, you'll see a message box for each text box that is really a child of the embedded charts. SMsg = "This text box is a child of the " This one, however, can step through each embedded chart in each worksheet and find each shape (text box) within that chart. In other words, the "parent" of the text box could either be the embedded chart or it could be the worksheet.Ī good way to find out if the text box is part of the embedded chart is to create a similar macro to the one just presented. 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. 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.
