Big Chemical Encyclopedia

Chemical substances, components, reactions, process design ...

Articles Figures Tables About

Sub Procedure to Apply Data Labels in a Chart

Creating a Sub Procedure TO Apply Data Labels in a Chart [Pg.295]

As described in Chapter 5, the Data Labels tab in the Format Data Series dialog box allows you to add data labels to a chart (to each data point in an XY chart, or to each column in a column chart, for example). But only the x values or the y values can be used as labels. You d probably like to use some other text as data labels. You can do this manually, by adding the data labels, then manually editing each one to enter the text you want. A macro will make the task much easier. [Pg.295]

In the following section we will develop a Sub procedure to assign text values in a range of cells as the data labels for a chart. Here s how we ll proceed we ll use the Recorder to obtain the code for adding data labels. [Pg.295]

Selection.AutoScaleFont = False With Selection.Characters(Start =1, Length =3).Font. Name = Geneva  [Pg.296]

In the first version of our macro, the chart must be the active document, and the user must have selected the data series to which the data labels are to be attached before running the macro. In a later version we ll allow the user to select the data series while the macro is running. [Pg.296]

Subscript = False OutlineFont = False Shadow = False [Pg.296]




SEARCH



Data Chart

Data labels

In procedure

Labeling procedures

© 2024 chempedia.info