Votre panier est actuellement vide !
Étiquette : chart
Creating a Report Template with a Chart Excel VBA
Let’s create a chart based on numerical data about world merchandise exports using the capabilities of Microsoft Excel 2010, following these steps:
- Prepare the data
Enter the data related to world merchandise exports on a Microsoft Excel worksheet.

- Select the data range
Highlight the prepared data range. - Insert the chart
Go to the Insert tab on the ribbon, and in the Charts group choose the required chart type.

- In our case, click the drop-down arrow under Column Chart and select 3-D Column.
Note: by clicking the Insert Chart dialog box launcher in the lower right corner of the Charts group, you can preview all available chart types in the corresponding window. - Chart placement
The chart will appear on the worksheet next to the data, and three additional contextual tabs will appear on the ribbon under Chart Tools: Design, Layout, and Format. - Format the chart
- First, enlarge the chart area by dragging its border with the mouse pointer (resize handle).
- Notice that for this chart type, when you enlarge the size, all data labels appear on the three axes.
- Next, remove the legend by clicking it and pressing .
- Go to the Design contextual tab, and in the Data group click Switch Row/Column if necessary to change the orientation of the data on the chart.
- In the same group, the Select Data button allows you to adjust the data range displayed on the chart.

- Add a chart title
On the Layout contextual tab, go to the Labels group, click Chart Title, and select Centered Overlay Title. In the title area that appears, type:
World Merchandise Exports, at 2000 Prices and PPP, in Billion USD. - Further customization
Using other options provided by the contextual tabs or each chart element’s context menu, change the chart style, chart area fill, and formatting of different chart elements.
Note: by selecting Move Chart in the Location group on the Design contextual tab, you can place the chart on a separate chart sheet in the Excel workbook. - Final result
The resulting chart may look, for example, as shown.

- Prepare the data
What You Need to Know About Charts with Excel VBA
In MS Excel, you can create two types of charts: embedded charts and charts on separate sheets. Embedded charts are created on the worksheet alongside tables, data, and text, and are mainly used in reports. Charts on separate sheets are more convenient for preparing slides or printing.
In the new version, Excel 2010, creating a chart is practically done with a single mouse click: select the prepared data for the chart, go to the Insert tab on the ribbon, and in the Charts group choose the required chart type. By default, the created chart is placed next to the data on the worksheet. When the chart is activated, three additional contextual tabs of the ribbon become available: Design, Layout, and Format. The tools on these tabs allow you to format the chart, change its type, style, location, etc.
MS Excel charts consist of different objects, each of which can be modified and formatted. In addition, MS Excel offers a variety of chart types.
Elements of an MS Excel chart include:
- Chart area
- Chart title
- Data point
- Plot area
- Value axis
- Side wall
- Data label
- Data series
- Back wall
- Category axis
- Floor
- Legend
Table. Types of MS Excel Charts
Chart Type Description Column Chart (Histogram) Used to compare individual values or their changes over a certain period of time. Suitable for displaying discrete data. Line Chart Displays the dependence of data (Y-axis) on a variable that changes at a constant rate (X-axis). Category axis labels should be arranged in ascending or descending order. Line charts are commonly used for commercial or financial data evenly distributed over time (continuous data), such as sales, prices, etc. Pie Chart Displays the relationship between parts and the whole, based on only one data series (the first in the selected range). Best used when components sum to 100%. Bar Chart Similar to column charts but rotated 90° clockwise. Used to compare separate values at a specific point in time; does not show changes over time. The horizontal layout helps emphasize positive or negative deviations from a reference value. Useful, for example, for displaying budget deviations across different categories. Area Chart Shows the cumulative change of values across data series and the contribution of each series to the total. Often used to represent production or sales processes over equally spaced intervals. Scatter Chart (XY) Clearly demonstrates data trends with irregular time intervals or measurement scales on the category axis. Useful for displaying discrete measurements on X and Y axes. The X-axis divisions are evenly distributed between the lowest and highest X values. Stock Chart Used to display stock market data (e.g., opening, closing, and highest prices). Shows sets of three or more values. Surface Chart Displays high and low points of a surface, used for datasets depending on two variables. The chart can be rotated and viewed from different angles. Doughnut Chart Similar to a pie chart but can display two or more data series to compare contributions of parts to a whole. Radar Chart (Spider Chart) Typically used to show relationships among multiple data series or to compare one specific series to all others. Each category has its own axis (ray). Data points along the rays are connected to form a shape representing the distribution of values. Useful for showing, for example, time distribution across project tasks. Bubble Chart Displays sets of three values in two dimensions: X and Y represent coordinates, while bubble size represents the third value. Additional Chart Operations
With charts, you can also:
- add or remove data series;
- edit, format, and add different chart elements;
- change the 3D orientation of charts;
- add graphical objects (arrows, callouts, etc.);
- adjust axes and scales;
- change chart types;
- create picture-filled charts (instead of color fill);
- link text on the chart to worksheet cells;
- build charts from structured data;
- use charts for data analysis, e.g., add trendlines and make forecasts.
Note
In Microsoft Office Excel 2010, a new feature was introduced: you can now place so-called sparklines directly in worksheet cells. Sparklines are microcharts displayed inside a single cell, visualizing data from the corresponding row in the table. With sparklines, you can show trends in value series (such as currency markets, economic cycles, sales by region, etc.) and highlight maximum and minimum values. Unlike regular charts, sparklines are not objects: essentially, a sparkline is the background of a cell. You can add a sparkline from the Sparklines group on the Insert tab of the ribbon. Further work with sparklines is done using the commands on the Design tab in the Sparkline Tools context mode.