ColorStops.Add method (Excel)

Adds a ColorStop object to the specified collection.

Syntax

expression.Add (Position)

expression An expression that returns a ColorStops object.

Parameters

Name Required/Optional Data type Description
Position Required Double Represents the position in which to apply the ColorStop.

Return value

ColorStop

Example

Adds a ColorStop for the active selection.

Range("A1:A10").Select 
With Selection.Interior.Gradient.ColorStop.Add(1) 
 .ThemeColor = xlThemeColorAccent1 
 .TintAndShade = 0 
End With

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.