Two-Color Gradient Fill?  
Author Message
SudakarRaja





PostPosted: Tue Sep 19 10:15:02 CDT 2006 Top

Excel Programming >> Two-Color Gradient Fill?

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

Excel206  
 
 
TomOgilvy





PostPosted: Tue Sep 19 10:15:02 CDT 2006 Top

Excel Programming >> Two-Color Gradient Fill? 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

--
Regards,
Tom Ogilvy




> 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
>
>
 
 
Zone





PostPosted: Tue Sep 19 10:48:32 CDT 2006 Top

Excel Programming >> Two-Color Gradient Fill? Sheesh, that was easy. Thanks, Tom.

> 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
>
> --
> Regards,
> Tom Ogilvy
>
>

>
> > 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
> >
> >

 
 
Tom





PostPosted: Fri Nov 24 00:32:01 CST 2006 Top

Excel Programming >> Two-Color Gradient Fill? Perfect info on this macro. Now if I can just get the color directional
correct. :)



> Sheesh, that was easy. Thanks, Tom.

> > 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
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >

> >
> > > 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
> > >
> > >
>
>