Chart gridline GraidentStops using VBA?

cpg

New Member
Joined
Aug 5, 2005
Messages
15
Dear forum,

I am making a lot of charts. I have used VBA to save most of the work, but the desired appearance is a blank white plot area, with no gridlines except for the X axis, no line separating the X-axis labels, and a vertical line separating series by X-axis categories. An example is:



To get the charts to look this way I am using gradient-fill gridlines (vertical and horizontal) to form (a) the x-axis, and (b) vertical line separating the categories. That is, by hand inserting three gradient stops (white – blue – white) for vertical, and three for horizontal. The verticals go at 48-50-52, the horizontals are more of a pain as the location of zero on the Y axis varies between charts.

When recording a macro, any change to the gridline format appears unhelpfully as “Selection.Format.Line.Visible = msoTrue”.

Any suggestions on where I might go from e.g. ActiveChart.Axes(xlCategory).MajorGridlines.Select to get the three gridlines applied to the verticals?

Many thanks!
Chris
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Sorry, the image in the above post should be

oan2ua.png


but I am out of time to edit it. Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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