Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping through charts in a worksheet
Hi there, I am sorting of blundering through this. I am
trying to get the following working: For Each chtObj In ActiveSheet ActiveSheet.ChartObjects(chtObj).Activate 'Make the data labels bold ActiveChart.SeriesCollection(1).DataLabels.Select Selection.Font.Bold = True 'Update the bars to a different colour ActiveChart.SeriesCollection(1).Select With Selection.Border .Weight = xlThin .LineStyle = xlAutomatic End With Selection.Shadow = False Selection.InvertIfNegative = False With Selection.Interior .ColorIndex = 37 .Pattern = xlSolid End With Next chtObj Any help appreciated, Grant. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping through charts in a worksheet
Hi Grant,
Try this modified code, Sub X() Dim chtObj As ChartObject For Each chtObj In ActiveSheet.ChartObjects With chtObj.Chart 'Make the data labels bold If .SeriesCollection(1).HasDataLabels Then .SeriesCollection(1).DataLabels.Font.Bold = True End If 'Update the bars to a different colour With .SeriesCollection(1) With .Border .Weight = xlThin .LineStyle = xlAutomatic End With .Shadow = False .InvertIfNegative = False With .Interior .ColorIndex = 37 .Pattern = xlSolid End With End With End With Next chtObj End Sub Cheers Andy Grant wrote: Hi there, I am sorting of blundering through this. I am trying to get the following working: For Each chtObj In ActiveSheet ActiveSheet.ChartObjects(chtObj).Activate 'Make the data labels bold ActiveChart.SeriesCollection(1).DataLabels.Select Selection.Font.Bold = True 'Update the bars to a different colour ActiveChart.SeriesCollection(1).Select With Selection.Border .Weight = xlThin .LineStyle = xlAutomatic End With Selection.Shadow = False Selection.InvertIfNegative = False With Selection.Interior .ColorIndex = 37 .Pattern = xlSolid End With Next chtObj Any help appreciated, Grant. -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping through to stop on pie charts | Excel Programming | |||
Looping Through Charts | Excel Programming | |||
Looping Through Charts | Excel Programming | |||
Looping through ComboBoxes in a worksheet | Excel Programming | |||
Looping checkboxes embedded in worksheet | Excel Programming |