Edit

Share via


ColorStops object (Excel)

A collection of all the ColorStop objects for the specified series.

Remarks

Each ColorStop object represents a color stop for a gradient fill in a range or selection.

Example

The following example shows the color stops with linear gradients.

With Selection.Interior 
 .Pattern = xlPatternLinearGradient 
 .Gradient.Degree = 90 
 .Gradient.ColorStops.Clear 
End With 
 
 'adds stops after any have been cleared 
With Selection.Interior.Gradient.ColorStops.Add(0) 
 .ThemeColor = xlThemeColorDark1 
 .TintAndShade = 0 
End With 
 
With Selection.Interior.Gradient.ColorStops.Add(1) 
 .ThemeColor = xlThemeColorAccent1 
 .TintAndShade = 0 
End With

The following example shows the color stops with rectangular gradients.

With Selection.Interior 
 .Pattern = xlPatternRectangularGradient 
 .Gradient.RectangleLeft = 0 
 .Gradient.RectangleRight = 0 
 .Gradient.RectangleTop = 0 
 .Gradient.RectangleBottom = 0 
 .Gradient.ColorStops.Clear 
End With 
 
With Selection.Interior.Gradient.ColorStops.Add(0) 
 .Color = 192 
 .TintAndShade = 0 
End With 
 
With Selection.Interior.Gradient.ColorStops.Add(1) 
 .ThemeColor = xlThemeColorLight1 
 .TintAndShade = 0 
End With

Methods

Properties

See also

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.