Microsoft Office Tutorials and References
In Depth Information
21.6.2.2 The Border property and the Border object
AxisTitleObject .Characters( start , length )
where start is the start character number and length is the number of characters to return in
the Characters object. When start is missing, it is assumed to be equal to 1, and when length is
missing, all characters after the starting character are included.
To illustrate, the following code creates a title for the primary value axis and italicizes the word
"billions." (Note the setting of the HasTitle property, to avoid an error message.)
With ActiveChart.Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "These are billions"
.AxisTitle.Characters(11, 8).Font.Italic = True
End With
Of course, if we wanted to italicize the entire title, we could simply use the Font property of the
AxisTitle object, as in:
ActiveChart.Axes(xlValue, xlPrimary). _
AxisTitle.Font.Italic = True
21.6.2.2 The Border property and the Border object
This property returns a Border object that represents the border of the object. The Border object
can be used to set the color, line style, and weight of the border of an object, such as an axis title.
The Border object has no methods. Its main properties are Color, ColorIndex, LineStyle, and
Weight.
The Color property can be set to any RGB value. For instance, the following code sets the major
axis color to blue:
ActiveChart.Axes(xlCategory, xlPrimary). _
MajorGridlines.Border.Color = RGB(0, 0, 255)
The ColorIndex property can be used to set the color via a color palette. For more information,
including the ColorIndex values, see the help documentation.
The LineStyle property can take on any of the following values:
Enum XlLineStyle
xlLineStyleNone = -4142
xlDouble = -4119
xlDot = -4118
xlDash = -4115
xlContinuous = 1
xlDashDot = 4
xlDashDotDot = 5
xlSlantDashDot = 13
End Enum
The Weight property can be set to one of the following XLBorderWeight constants:
Enum XlBorderWeight
xlMedium = -4138
xlHairline = 1
Search JabSto ::




Custom Search