PlotArea and GradientAngle

AgentSmith

Well-known Member
Joined
Mar 8, 2004
Messages
575
I have a chart which has a gradient fill in the Plot Area. For the chart to look right, users must adjust the gradient stop positions and angle of the gradient by eye. To help them I'm providing a couple of controls. The stop positions are easy enough to work with in VBA but I can't see how to work with the angle of the gradient. Individual series have a GradientAngle property (series.Format.Fill.GradientAngle) but the PlotArea.Format.Fill object does not.

Any suggestions how I can do something equivalent?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
The GradientAngle property is a member of the FillFormat object which is returned by the Fill property. So this worked for me in Excel 2010:

MsgBox ActiveChart.PlotArea.Format.Fill.GradientAngle
 
Upvote 0
I'm using Excel 2007 (no choice) and that doesn't work. I guess it must have been left out in the 2007 version.
 
Upvote 0
Yes the property was introduced in Excel 2010. I'm surprised that this works for you:

Series.Format.Fill.GradientAngle
 
Upvote 0
Actually no it doesn't. (TBH I didn't test it because it wasn't what I wanted!)

I think I'm just going to leave it for the user to do via the conventional route. Thanks for the quick replies though :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top