Change All Charts from Line to Bar

JonesyUK

Board Regular
Joined
Oct 11, 2005
Messages
190
Office Version
  1. 365
Platform
  1. Windows
Hi, I have 200 charts on 1 sheet, and I need to change all of them from line charts to bar charts please.

Any macro that will do this quickly?

Thanks,
CJ
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try like this

Code:
Sub test()
Dim ch As ChartObject
For Each ch In ActiveSheet.ChartObjects
    ch.Chart.ChartType = xlBarClustered
Next ch
End Sub
 
Upvote 0
Thanks!, what about the following:

I've recorded the following Macro in Excel:

ActiveSheet.ChartObjects("Chart 8").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.ChartGroups(1).GapWidth = 0
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0.3399999738
.ForeColor.Brightness = 0
.BackColor.ObjectThemeColor = msoThemeColorAccent1
.BackColor.TintAndShade = 0.7649999857
.BackColor.Brightness = 0
.TwoColorGradient msoGradientHorizontal, 1
End With
Selection.Format.Shadow.Type = msoShadow24

End Sub

I need to run this macro on about 200 charts which are all on a sheet named "CHARTS"

Can you please help me to edit this macro so that it goes through all the charts and applies these formats?

Thanks!
C
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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