Saving A Chart As A GIF FIle
Category: Charts & Graphics | [Item URL]
If you would like to convert an Excel chart to a GIF file, you can save your worksheet as an HTML file, and Excel will automatically convert any charts to GIF files. If that seems like overkill, you can write a simple macro that will do the job.
Press Alt-F11 to activate the Visual Basic editor. Select your workbook in the Projects window, and choose Insert, Module to insert a new VBA module. Then type the following four-line procedure into the module:
Sub SaveChartAsGIF ()
Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
ActiveChart.Export FileName:=Fname, FilterName:="GIF"
End Sub
After the macro is entered, reactivate Excel and click the chart to be saved. Press Alt-F8 to display the Macro dialog box. Select the SaveChartAsGIF macro and click Run.
The procedure uses the chart's name as the GIF file name, and the file is stored in the same directory as the workbook. This simple macro does no error checking, so it will generate an error if a chart is not selected or if the workbook has not been saved.
Rotating Text With An AutoShape
Category: Charts & Graphics | [Item URL]
If you use Excel's AutoShapes, you've probably discovered a limitation: If you add text to an AutoShape, the text is not rotated when the AutoShape is rotated.
Method 1
Here's one way to circumvent that problem:
- Create your AutoShape, add text, and format it to your liking.
- Ctrl+Click the AutoShape to select it. Pressing Ctrl ensures that you select the AutoShape itself, not the text inside.
- Press Shift, and choose Edit - Copy Picture. This command is available only when the Shift key is pressed.
- In the Copy Picture dialog box, choose As shown on screen, and Picture. Click OK.
- Choose Edit - Paste
The result is a picture of the AutoShape. But, unlike the AutoShape, the text is also rotated when the AutoShape is rotated.
The only potential problem with this technique is that you can no longer edit the text or modify the formatting of the graphic.
Method 2
Another option is to delete the text from your AutoShape, and use WordArt for the text. Then you can group these two objects (the WordArt and the AutoShape). After doing so, both objects will rotated together.
Creating A Transparent Chart Series
Category: Charts & Graphics | [Item URL]
Excel charts do not support color transparency. When you apply a color to a bar or column chart series, the color must be a solid color. Although the Fill Effects dialog box includes Transparency controls, these controls are disabled.
This tip describes how to make a bar or column series transparent by pasting a picture. The figure below shows a chart after the column series has been made transparent. Notice that the gridlines show through the columns.
Following are the steps required.
- Create the chart as usual. It must be a bar chart or a column chart.
- Display the Drawing toolbar, and add a Rectangle AutoShape to your worksheet.
- Double-click the Rectangle to display the Format AutoShape dialog box.
- In the AutoShape dialog box, select the Colors and Lines tab.
- Use the Color control to select a color.
- Use the Transparency scrollbar to specify a transparency setting
- For best results, use the Line Color control and specify No Line.
- Close the Format AutoShape dialog box.
- Select the AutoShape. Press Shift, and select Copy - Picture (this command is available only when the Shift key is pressed). Accept the default settings.
- Activate your chart and click the bar or column series.
- Choose Edit - Paste, to paste the copied AutoShape.
- If you formatted the AutoShape without a border, you may prefer to add a border to your chart series. Double-click the series and use the Patterns tab in the Format Data Series dialog box.
In the example below, the transparent AutoShape was formatted with a rainbow gradient.
Creating Combination Charts
Category: Charts & Graphics | [Item URL]
A combination chart is a chart that combines two or more chart types in a single chart -- for example, a chart that has a line series and a column series. When you choose the Custom Types tab in the first step of the Chart Wizard, you'll find the following combination charts listed:
- Column - Area
- Line - Column
Many users think that these are the only two combination charts that are possible. In fact, you have a great deal of flexibility in creating combination charts. They key is understanding how the Chart - Chart Type command works. When you select this command, it works in either of two ways:
If a series is selected in the chart, the chart
type that you choose applies only to the selected
series.Or...
If anything other than a series is selected, the chart
type that you choose applies to all series in the chart.
For example, assume you want to create a combination chart that displays a column, a line, and an area.
- Start by creating a column chart.
- Select the second chart series and choose Chart - Chart Type. Select a line chart type for that series.
- Select the third series and repeat this command, but choose an area chart type. The result is a combination chart that shows three different chart types.
Note:
Not all chart types can be used in a combination chart. For example, Excel does not allow any of the 3-D chart types to be used in a combination chart.
The figure below carries this concept to the extreme. This combination chart displays five series, and each series uses a different chart type. This chart, of course, is provided for demonstration purposes only. I can't think of any situation that would warrant such a confusing chart!
Animated Hypocycloid Charts
Category: Charts & Graphics / General VBA | [Item URL]
A companion file is available: Click here to download
With a few simple macros, you can creating some interesting animation effects in charts. For example, I created a workbook that displays an infinite number of dazzling animated charts. The workbook is set up with a simple user interface that makes it very easy to generate a new chart or save the parameters for charts that you like. Turn animation on or off with the click of a button.
The chart displays what's known as a hypocycloid curve -- the path formed by a point on a circle that rolls inside of another circle. This, as you may recall from your childhood, is the same technique used in Hasbro's popular Spirograph toy.
The workbook is not protected, so you can view the formulas and VBA macros that are used.

[Previous page]
Excel Tips
Excel has a long history, and it continues to evolve and change. Consequently, the tips provided here do not necessarily apply to all versions of Excel.
In particular, the user interface for Excel 2007 (and later), is vastly different from its predecessors. Therefore, the menu commands listed in older tips, will not correspond to the Excel 2007 (and later) user interface.
All Tips
Browse Tips by Category
Search for Tips
Tip Books
Needs tips? Here are two books, with nothing but tips:
Contains more than 200 useful tips and tricks for Excel 2007 | Other Excel 2007 books | Amazon link: John Walkenbach's Favorite Excel 2007 Tips & Tricks
Contains more than 200 useful tips and tricks for Excel | Other Excel 2003 books | Amazon link: John Walkenbach's Favorite Excel Tips & Tricks





