Set Gap Width on a Vertical bar series

Mitchbvi

New Member
Joined
Mar 6, 2014
Messages
39
I am using Excel for Mac 2011 to build a simple Monte Caro Analysis. The end result two charts a Histogram and a Cumulative Frequency Chart.
The second chart is a line chart with one bar element being the median of the cumulative frequency. What I want to do is set the width of that bar (series, all bar one are zero) to make it as narrow as possible .

Easy to do manually but cannot figure out who to do it programmatically .
This runs but does not change the size.
Code:
Sub setgapwidth3()   
 ActiveChart.ChartArea.Select
    ActiveChart.SeriesCollection(2).Select
    ActiveChart.ChartGroups(2).GapWidth = 500
    ActiveChart.Activate
End Sub

It may be a Mac issue as I have found a response developed by recording a macro I have tried that but the macro shows the selection of the chart and the series but not the result of changing the gap width in options.

Thanks for any suggestions.

Peter
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
if you step through with f8 watching the chart

i had a set the otherday that completed sucsesfully yet the last line of code reset the chart, couldn't be seen whilst running normally
 
Upvote 0
Thank you for that suggestion on my Mac its Command Shift I (to step though a macro) and I have been stepping through the Macro and I can see the chart selected then the series but after that nothing.

Peter
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,220
Members
448,876
Latest member
Solitario

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