Border.Color property (Excel)

Returns or sets the primary color of the object, as shown in the table in the remarks section. Use the RGB function to create a color value. Read/write Variant.

Syntax

expression.Color

expression An expression that returns a Border object.

Remarks

Object Color
Border The color of the border.
Borders The color of all four borders of a range. If they're not all the same color, Color returns 0 (zero).
Font The color of the font.
Interior The cell shading color or the drawing object fill color.
Tab The color of the tab.

Important

Note that the visual properties of a Border object are interlocked; that is, changing one property can induce changes in another. In most cases, the induced changes serve to make the border visible (which may or may not be desirable). However, other (more unexpected) results are possible. For an example, see the Border object.

Example

This example sets the color of the tick-mark labels on the value axis on Chart1.

Charts("Chart1").Axes(xlValue).TickLabels.Font.Color = _ 
 RGB(0, 255, 0)

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.