Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Looping Through Charts

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
-----Original Message-----
How do I loop through charts, not embedded charts but a

chart that is in't own sheet , then run a script to change
the chart. Then on to the next chart.

Thanks, JD
.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping Through Charts

Thanks everyone. I got it to work from your hel
JD
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
Looping Through Charts No Name Excel Programming 1 May 20th 04 10:36 PM
Looping Andrew Clark[_2_] Excel Programming 1 December 20th 03 05:01 PM
Looping [email protected] Excel Programming 0 October 31st 03 07:47 PM
Looping Stuart[_9_] Excel Programming 0 October 29th 03 11:31 PM


All times are GMT +1. The time now is 11:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"