M
Mike Waldron
Hi Chris
This isn't a easy as it looks. Excel handles charts on
their own sheet as CHARTS but charts in a worksheet as
CHARTOBJECTS. Here are 2 methods for each.
Sub test()
' use for charts on their own sheet
chtcnt = ActiveWorkbook.Charts.Count
For i = 1 To chtcnt
your code
Next i
or
dim cht as Chart
For Each cht In Charts
cht.Select
your code
Next
'use for charts on a worksheets with data
chtobcnt = ActiveSheet.ChartObjects.Count
For i = 1 To chtobcnt
your code
Next
or
Sheets(your worksheet).Select
Dim ocht As ChartObject
For Each ocht In ActiveSheet.ChartObjects
ocht.Select
your code
Next
End Sub
the chart. Then on to the next chart.
This isn't a easy as it looks. Excel handles charts on
their own sheet as CHARTS but charts in a worksheet as
CHARTOBJECTS. Here are 2 methods for each.
Sub test()
' use for charts on their own sheet
chtcnt = ActiveWorkbook.Charts.Count
For i = 1 To chtcnt
your code
Next i
or
dim cht as Chart
For Each cht In Charts
cht.Select
your code
Next
'use for charts on a worksheets with data
chtobcnt = ActiveSheet.ChartObjects.Count
For i = 1 To chtobcnt
your code
Next
or
Sheets(your worksheet).Select
Dim ocht As ChartObject
For Each ocht In ActiveSheet.ChartObjects
ocht.Select
your code
Next
End Sub
chart that is in't own sheet , then run a script to change-----Original Message-----
How do I loop through charts, not embedded charts but a
the chart. Then on to the next chart.