LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default ChartObjects.Count is incorrect

That solved my 'ghost' chart issues, thanks!
--
Disregard, this is so I can find my post later.
***postedbyJay***


"Peter T" wrote:

Hi Jay,

Maybe someone assumed that deleting rows or columns containing charts also
deletes the charts, rather than making them zero width or height and
effectively invisible.

Sub FindNonDeletedCharts()
Dim chtobj As ChartObject
For Each chtobj In ActiveSheet.ChartObjects
If chtobj.Width < 20 Then
chtobj.Width = 200
chtobj.Chart.ChartArea.Interior.ColorIndex = 3
End If
If chtobj.Height < 20 Then
chtobj.Height = 100
chtobj.Chart.ChartArea.Interior.ColorIndex = 3
End If
Next

Regards,
Peter T

"Jay" wrote in message
...
Hello all,

I've run into a stupid issue, and I'm not sure how to get around it.

I'm trying to automatically change the data source of a chart. Basically
every month I need to move the data source ahead by a row (advance the

chart
window by a month).

I'm trying to loop through the chart objects of the worksheet and I guess
there were numerous charts added then deleted. So my ChartObjects.Count
returns 13, but there are only 6 charts.

How can I either:
a) Reset the counter of ChartObjects?
b) Edit the chart names to be (for example) Chart 1 - Chart 6? Right now,
it's not consistent what charts were left. There's no continuous run of
values I can loop through.
c) Only look at valid charts? The chart has a name, so I can't screen out
using that variable. Maybe another is (consistently) missing from
non-viewable charts? I don't know.

Any ideas are appreciated.

Thanks,
Jay

--
Disregard, this is so I can find my post later.
***postedbyJay***




 
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
IF/COUNT/AVERAGE... Value returned is incorrect. Rebekah Excel Worksheet Functions 3 September 28th 07 04:25 PM
F1 help for ChartObjects John Excel Programming 1 October 21st 06 02:36 AM
ChartObjects Scott Excel Programming 1 June 30th 06 12:23 AM
Datedif incorrect month count - February problem?? JMKCT Excel Worksheet Functions 4 December 14th 05 03:36 PM
ChartObjects Nick Excel Programming 2 August 19th 04 12:04 PM


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

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

About Us

"It's about Microsoft Excel"