Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 151
Default Changing many charts in one worksheet

I have a worksheet with over 100 similar small datatables and charts. It has
been asked of me that I now chart one more column of data from each table.
The data is there and I can record a simple macro to plot the additional
series from the first table to the first chart. My question is, how do I get
the macro to go to the next table and plot the additional data to the next
chart. The data is always in the same column, different rows.
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Changing many charts in one worksheet

I tested this simple macro on a worksheet with three charts. Each used data
from B:D to populate two series and there was additional data in E. The
macro checked that there were fewer than 3 series, and if so it copied the
formula from the second series, changed the column from D to E in the
formula, and applied the formula to a new series.

Sub ExtendOneColumn()
Const NumSeries As Long = 3
Const sOldCol As String = "$D$"
Const sNewCol As String = "$E$"

Dim iChtOb As Long
Dim Cht As Chart
Dim Srs As Series
Dim sFmla As String

For iChtOb = 1 To ActiveSheet.ChartObjects.Count
Set Cht = ActiveSheet.ChartObjects(iChtOb).Chart
With Cht.SeriesCollection
If .Count < NumSeries Then
sFmla = .Item(NumSeries - 1).Formula
Set Srs = .NewSeries
With Srs
sFmla = Replace(sFmla, sOldCol, sNewCol)
.Formula = sFmla
End With
End If
End With
Next
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Libby" wrote in message
...
I have a worksheet with over 100 similar small datatables and charts. It
has
been asked of me that I now chart one more column of data from each table.
The data is there and I can record a simple macro to plot the additional
series from the first table to the first chart. My question is, how do I
get
the macro to go to the next table and plot the additional data to the next
chart. The data is always in the same column, different rows.



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
Changing the Same thing on multiple charts mea Charts and Charting in Excel 1 April 24th 07 12:54 PM
Why won't my pie charts update with changing data? Wiko Charts and Charting in Excel 3 November 10th 06 05:26 PM
An easy way to changing refrence on several charts Henning Charts and Charting in Excel 2 August 7th 06 07:33 AM
Dates Keep changing in Excel Charts Tom Excel Discussion (Misc queries) 1 March 8th 06 04:39 PM
Changing Colors in Bar Charts Joe Excel Worksheet Functions 2 January 19th 05 03:25 PM


All times are GMT +1. The time now is 01:12 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"