Chapter 15

Creating charts

In this chapter, you will:

  • Use .AddChart2 to create a chart

  • Understand chart styles

  • Format a chart

  • Create a combo chart, map chart, and waterfall chart

  • Export a chart as a graphic

  • Consider backward compatibility

Two new chart types have been introduced since Excel 2016. The filled map chart and the funnel chart join the six chart types that were added to Excel 2016.

More importantly, the macro bug that prevented Excel 2016 from creating the new charts has been fixed. Whether you are creating a new Ivy chart or a legacy chart, you can use this code:

Dim CH As Chart Set CH = ActiveSheet.Shapes _ .AddChart2(-1, xlRegionMap).Chart CH.SetSourceData Source:=Range("D1:E7") ' Settings specific ...

Get Microsoft Excel VBA and Macros (Office 2021 and Microsoft 365) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.