Contents
After reading this article, you will learn how to create a separate graphic file (.png, .jpg, .bmp or other format) from a chart in Excel or export it, for example, to a Word document or a PowerPoint presentation.
Microsoft Excel is one of the most powerful data analysis applications. In its arsenal there are many tools and functions for visualizing this data. Charts (or graphs) are one such tool. To create a chart in Excel, you just need to select the data and click the chart icon in the corresponding menu section.
But, speaking of the merits, it is necessary to mention the weaknesses. Unfortunately, there is no easy way in Excel to save a chart as a picture or export it to another document. It would be great if we could just right click on the graph and see a command like Save as drawing or Export. But, since Microsoft did not take care of creating such functions for us, then we will come up with something ourselves.
In this article, I’ll show you 4 ways to save an Excel chart as a picture that you can later paste into other Office documents, including Word and PowerPoint, or use it to create some attractive infographics.
Copy the diagram to a graphics editor and save as an image
A friend of mine once shared a secret with me: she usually copies her charts from Excel to Paint. She creates a chart and just presses a key PrintScreen, then opens Paint and pastes the screenshot. After that, it crops the unwanted areas of the image and saves the remaining image to a file. If you have done the same so far, then rather forget it and never use this childish method again! We will act faster and smarter! 🙂
For example, in my Excel 2010, I created a beautiful XNUMX-D pie chart that displays data about the demographics of our site visitors, and now I want to export this chart from Excel as a picture. Let’s do it together:
- Right click on the chart area and click Copy (Copy). There is no need to click on the graph itself, since this will select individual elements, and not the entire diagram, and the command Copy (Copy) will not appear.
- Open Paint and paste the chart using the icon Insert (Paste) tab Home (Home) and pressing Ctrl + V.
- Now it remains only to save the diagram as a graphic file. Click Save as (Save as) and select one of the suggested formats (.png, .jpg, .bmp or .gif). If you want to choose a different format, click Other formats (Other formats) at the end of the list.
It doesn’t get easier! To save an Excel chart in this way, any graphics editor will do.
Export a chart from Excel to Word or PowerPoint
If you need to export a chart from Excel to some other Office application, such as Word, PowerPoint, or Outlook, the best way to do this is through the clipboard.
- Copy the chart from Excel as in the previous example on Step 1.
- In a Word document or PowerPoint presentation, click where you want to insert the chart and click Ctrl + V. Or instead of pressing Ctrl + V, right-click anywhere in the document, and a whole set of additional options will open in front of you in the section Paste Options (Paste options).
The main advantage of this method is that in this way a fully functional Excel chart is exported to another file, and not just a picture. The graph will remain linked to the original Excel sheet and will automatically update when the data in that Excel sheet changes. This means that you do not have to copy and paste the chart again with each change in the data used to build it.
Save a chart in Word and PowerPoint as a picture
In Office 2007, 2010, and 2013 applications, an Excel chart can be copied as a picture. In this case, it will behave like a normal picture and will not be updated. For example, let’s export an Excel chart to a Word 2010 document.
- In an Excel workbook, copy the chart, then open a Word document, place the cursor where you want to paste the chart, and click the little black arrow at the bottom of the button Insert (Paste), which is located on the tab Home (Home).
- In the menu that opens, we are interested in the item Paste special (Paste Special) – It is indicated by an arrow in the screenshot above. Click on it – a dialog box of the same name will open with a list of available graphic formats, including Bitmap (bitmap), GIF, PNG and JPEG.
- Select the desired format and click OK.
Most likely a tool Paste special (Paste Special) is also available in earlier versions of Office, but at that time I did not use it, so I will not say 🙂
Save all Excel workbook charts as pictures
The methods we have just discussed are handy when it comes to a small number of diagrams. But what if you need to copy all charts from an Excel workbook? If you copy and paste each of them individually, it can take quite a long time. I hasten to please you – you don’t have to do this! There is a way to save all charts from an Excel workbook at once.
- When you’re done creating charts in your workbook, click the File (File) and click the button Save as (Save as).
- A dialog box will appear Saving a document (Save as). In drop down list File Type (Save as type) select Веб-страница (Web page, *.htm, *.html). Also check that in the section Save (Save) option selected Whole Book (Entire Workbook) as shown in the screenshot below:
- Select a folder to save files and click the button Save (Save).
To the selected folder along with the files .html all charts contained in the Excel workbook as files will be copied . Png. The screenshot below shows the contents of the folder where I saved my workbook. My Excel workbook consists of three sheets with a chart on each – and in the folder I have chosen, we see three charts saved as graphic files . Png.
As you know, PNG is one of the best image compression formats in which there is no loss of quality. If you prefer to use other image formats, then convert them to .jpg, . Gif, .bmp or any other will not be difficult.
Saving a Chart as an Image Using a VBA Macro
If you often need to export Excel charts as pictures, you can automate this task using a VBA macro. Fortunately, there are many such macros already written, so we don’t have to reinvent the wheel 🙂
For example, you can use the tried and true solution posted by John Peltier on his blog. Its macro is very simple:
ActiveChart.Export "D:My ChartsSpecialChart.png"
This line of code creates a graphic file in the given folder . Png and exports the diagram to it. You can create your first macro right now in 4 easy steps, even if you have never done it before in your life.
Before you start writing a macro, prepare a folder for chart export. In our case, this will be the folder My Charts on disk D. So, all the preparations are completed, let’s do the macro.
- In your Excel workbook, open the tab developer (Developer) and in the section Code (Code) click icon Macros (Macros).
Note: If you create a macro for the first time, then, most likely, the tab developer (Developer) will be hidden. In this case, go to the tab File (File), click Parameters (Options) and open the section Configure ribbon (Customize Ribbons). In the right part of the window, in the list Main tabs (Main Tabs) check the box next to developer (Developer) and click OK.
- Give a name to the new macro, for example, SaveSelectedChartAsImage, and make it available only for this workbook.
- Нажмите кнопку Create (Create), this will open the Visual Basic editor window, in which the beginning and end of the new macro will already be indicated. In the second line, copy the following macro text:
ActiveChart.Export "D:My ChartsSpecialChart.png"
- Close the Visual Basic Editor and on the tab File (Filet) knead Save as (Save as). Save your workbook as Macro-enabled Excel workbook (Excel Macro-Enabled Workbook, *.xlsm). That’s it, you did it!
Now let’s run the macro we just created to see how it works. Wait a minute… There’s one more thing we need to do. We need to select the Excel chart we want to export because our macro only works with the selected chart. Click anywhere on the edge of the chart. A light gray frame that appears around the diagram will indicate that it is fully selected.
Open the tab again developer (Developer) and click the icon Macros (macros). A list of macros available in your workbook will open. Highlight SaveSelectedChartAsImage And click the Run (Run).
Now open the folder that you specified to save the file – there should be a picture . Png with exported diagram. You can save charts in a different format in the same way. To do this, it is enough to change in the macro . Png on .jpg or . Gif – like this:
ActiveChart.Export "D:My ChartsSpecialChart.jpg"
That’s all for today, and I hope you’ve had a good time reading this article. Thank you for attention!