Class ColorStops (Excel VBA)

A collection of all the ColorStop objects for the specified series. To use a ColorStops class variable it first needs to be instantiated, for example


Dim css as ColorStops
Set css = ActiveCell.Interior.Gradient.ColorStops

For Each

Here is an example of processing the ColorStops items in a collection.


Dim cstp As ColorStop
For Each cstp In ActiveCell.Interior.Gradient.ColorStops
	
Next cstp

Add

Adds a ColorStop object to the specified collection.

Add (Position)

Position: Represents the position in which to apply the ColorStop.


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

Clear

Clears the represented object.


ActiveCell.Interior.Gradient.ColorStops.Clear

Count

Returns or sets the count of the represented object.


Dim lngCount As Long
lngCount = ActiveCell.Interior.Gradient.ColorStops.Count

Item

Returns a single object from the represented collection.

Item (Index)

Index: The name or index number for the object.


Dim cstp As ColorStop
Set cstp = ActiveCell.Interior.Gradient.ColorStops(Index:=1)