Microsoft Office Tutorials and References
In Depth Information
Pasting a semitransparent shape to a series
Sub FreezeTextSize()
If ActiveChart Is Nothing Then
MsgBox “Select a chart.”
Exit Sub
End If
ActiveChart.ChartArea.AutoScaleFont = False
End Sub
The JWalk Chart Tools add-in, available on the companion CD-ROM,
includes a utility to freeze the text size in charts.
Pasting a semitransparent shape to a series
In Chapter 6, I describe a technique to make chart bars or columns semitransparent
by copying and pasting a shape object. The technique works well but requires
several steps: Create a shape; format it to make it semitransparent; copy it; paste it to
a chart series; delete the shape. The following macro automates this process.
Sub MakeSeriesTransparent()
Dim TempShape As Shape
Dim TheColor as Double
Dim Ser As Series
Dim BorderLineStyle As Integer
Dim BorderColorIndex As Integer
Dim BorderWeight As Integer
If ActiveChart Is Nothing Then Exit Sub
Application.ScreenUpdating = False
For Each Ser In ActiveChart.SeriesCollection
If (Ser.ChartType = xlColumnClustered Or _
Ser.ChartType = xlColumnStacked Or _
Ser.ChartType = xlColumnStacked100 Or _
Ser.ChartType = xlBarClustered Or _
Ser.ChartType = xlBarStacked Or _
Ser.ChartType = xlBarStacked100) Then
‘Save the color and border settings
TheColor = Ser.Interior.Color
BorderLineStyle = Ser.Border.LineStyle
BorderColorIndex = Ser.Border.ColorIndex
BorderWeight = Ser.Border.Weight
‘ Create a Shape
Set TempShape = ActiveSheet.Shapes.AddShape _
(msoShapeRectangle, 1, 1, 100, 100)
With TempShape
Search JabSto ::

Custom Search