Version Information
Version Added: Excel
Remarks
Each ColorStop Object represents a color stop for gradient fill in a range or selection.
Example
The following example shows the ColorStops with LinearGradients.
| Visual Basic for Applications
|
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 ColorStops with RectangularGradients.
| Visual Basic for Applications
|
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
|
See also: