Two-Color Gradient Fill?

Z

Zone

I've discovered the gradient fill for shapes, which I really like. But
it always seems to use black for the shading and a VBA statement such
as Fill OneColorGradient. Evidently the RGB colors are used for the
forecolor, but the back color is black for the shading. Is there a way
to use a TwoColorGradient, using the back RGB colors for the shading?
TIA, James
 
T

Tom Ogilvy

Sub ABC()
Set myDocument = Worksheets(2)
With myDocument.Shapes.AddShape(msoShapeRectangle, _
90, 90, 90, 50).Fill
.ForeColor.RGB = RGB(239, 250, 130)
.BackColor.RGB = RGB(226, 154, 212)
.TwoColorGradient msoGradientHorizontal, 1
End With
End Sub
 
Z

Zone

Sheesh, that was easy. Thanks, Tom.
Tom said:
Sub ABC()
Set myDocument = Worksheets(2)
With myDocument.Shapes.AddShape(msoShapeRectangle, _
90, 90, 90, 50).Fill
.ForeColor.RGB = RGB(239, 250, 130)
.BackColor.RGB = RGB(226, 154, 212)
.TwoColorGradient msoGradientHorizontal, 1
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top