Class LinearGradient (Excel VBA)

The LinearGradient object transitions through a series of colors in a linear manner along a specific angle. To use a LinearGradient class variable it first needs to be instantiated, for example


Dim lgt as LinearGradient
Set lgt = ActiveCell.Interior.Gradient

ColorStops

Returns the ColorStops object for the LinearGradient object.


Dim cssColorStops As ColorStops
Set cssColorStops = ActiveCell.Interior.Gradient.ColorStops

Degree

The angle of the linear gradient fill within a selection.

Uses values ranging from 0–360.


ActiveCell.Interior.Gradient.Degree = 45