Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default How to deteremine the number of trendline in chart?

Hi, I have a lot of charts (say ~110 charts) and would like to delete
all the trendline. However, the number of each chart may not be same.
Therefore, I need to determine the number of trendline by every chart.
Can commend to do it?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default How to deteremine the number of trendline in chart?

This procedure will remove all trendlines in all embedded charts and
chart sheets in the active workbook:


Sub KillTrendlines()
Dim sh As Object
Dim chtob As ChartObject
Dim cht As Chart
Dim srs As Series
Dim tr As Trendline

For Each sh In ActiveWorkbook.Sheets
For Each chtob In ws.ChartObjects
For Each srs In chtob.Chart.SeriesCollection
For Each tr In srs.Trendlines
tr.Delete
Next
Next
Next
Next

For Each cht In ActiveWorkbook.Charts
For Each srs In cht.SeriesCollection
For Each tr In srs.Trendlines
tr.Delete
Next
Next
Next

End Sub


- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Danny wrote:
Hi, I have a lot of charts (say ~110 charts) and would like to delete
all the trendline. However, the number of each chart may not be same.
Therefore, I need to determine the number of trendline by every chart.
Can commend to do it?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default How to deteremine the number of trendline in chart?

On Oct 22, 6:32*am, Jon Peltier wrote:
This procedure will remove all trendlines in all embedded charts and
chart sheets in the active workbook:

Sub KillTrendlines()
* *Dim sh As Object
* *Dim chtob As ChartObject
* *Dim cht As Chart
* *Dim srs As Series
* *Dim tr As Trendline

* *For Each sh In ActiveWorkbook.Sheets
* * *For Each chtob In ws.ChartObjects
* * * *For Each srs In chtob.Chart.SeriesCollection
* * * * *For Each tr In srs.Trendlines
* * * * * *tr.Delete
* * * * *Next
* * * *Next
* * *Next
* *Next

* *For Each cht In ActiveWorkbook.Charts
* * *For Each srs In cht.SeriesCollection
* * * *For Each tr In srs.Trendlines
* * * * *tr.Delete
* * * *Next
* * *Next
* *Next

End Sub

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.http://peltiertech.com/



Danny wrote:
Hi, I have a lot of charts (say ~110 charts) and would like to delete
all the trendline. However, the number of each chart may not be same.
Therefore, I need to determine the number of trendline by every chart.
Can commend to do it?- Hide quoted text -


- Show quoted text -


It works, Thanks.
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
average/trendline in chart DC Gringo Charts and Charting in Excel 3 January 3rd 08 04:37 AM
No add a trendline under chart tab. mromero Excel Discussion (Misc queries) 2 September 4th 07 01:20 PM
Pivot Chart trendline Milka Charts and Charting in Excel 1 January 11th 07 02:51 PM
Trendline erases chart name jase Charts and Charting in Excel 1 June 21st 06 11:30 PM
R² expression for trendline in chart jean Charts and Charting in Excel 1 December 23rd 04 07:51 AM


All times are GMT +1. The time now is 10:03 PM.

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"