Microsoft Office Tutorials and References
In Depth Information
Pasting a semitransparent shape to a series
.Fill.ForeColor.RGB = TheColor
.Fill.Transparency = 0.4
.Line.Visible = msoFalse
End With
‘ Copy and paste the Shape
TempShape.CopyPicture Appearance:=xlScreen, Format:=xlPicture
With Ser
.Paste
‘Apply saved border settings
.Border.Weight = BorderWeight
.Border.LineStyle = BorderLineStyle
.Border.ColorIndex = BorderColorIndex
End With
TempShape.Delete
End If
Next Ser
End Sub
The MakeSeriesTransparent macro works with the active chart and loops
through each series. If the series is a bar or column series, it assigns its fill color to
a variable and uses additional variables to remember the border settings for the
series. It then creates a temporary shape object, sets the transparency to 40% and
removes the border, copies the shape, pastes it to the series, applies the stored
border settings, and deletes the shape. This all happens instantly.
Figure 16-7 shows a chart before and after the series were made transparent.
Note that in the bottom chart, the gridlines are visible through the columns.
Figure 16-7: A chart, before and after using the
MakeSeriesTransparent macro
Search JabSto ::




Custom Search