LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Changing formulae for series in line charts

Dear all,

I'm trying to change the formulae in many line charts by
adding four points
to each chart, i.e. the old range goes through to
column "Z", the new range
is supposed to go through to column "AD".

Whenever I do this, the third series gets the data from
the first series
(subsequent series are ok again), and I have no clue, why
that might be the
case. Any ideas?

Regards, Ulrike

Code:
Sub makelonger()
For i = 12 To 19
For j = 1 To Worksheets(i).ChartObjects.Count
anz = Worksheets(i).ChartObjects
(j).Chart.SeriesCollection.Count
For k = 1 To anz
titel = Worksheets(i).ChartObjects
(j).Chart.Name
On Error GoTo naechste
formel =
Worksheets(i).ChartObjects(j).Chart.SeriesCollecti on
(k).Formula
formelneu = formel
If InStr(formel, "Z") 0 Then _
formelneu = Left(formel, InStr
(formel, ":$Z")) & "$AD" & _
Right(formel, Len(formel) - InStr
(formel, "Z"))
If InStr(formelneu, "Z") 0 Then _
formelneu = Left(formelneu, InStr
(formelneu, ":$Z")) & "$AD"
& _
Right(formelneu, Len(formelneu) - InStr
(formelneu, "Z"))
Worksheets(i).ChartObjects
(j).Chart.SeriesCollection(k).Formula
= formelneu
naechste:
Next k
Next j
Next i
End Sub



 
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
Dynamic Charts - Changing Number of Series Ben Weyenberg Charts and Charting in Excel 3 July 8th 08 10:30 PM
Changing a data series in a graph from a line to a bar japc90 Excel Discussion (Misc queries) 1 March 20th 08 04:20 PM
Changing order of series in line-column chart Tim Charts and Charting in Excel 1 January 23rd 08 12:32 PM
Change data Series from a bar to a line after changing axis Aaron Charts and Charting in Excel 1 August 17th 07 03:11 AM
Changing a charts series order Csmith Charts and Charting in Excel 1 July 19th 07 09:49 AM


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