Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Referring to data series in a chart

Hi,

I currently have a chart with dataseries that are named "Smith",
"Jones" "Brown" etc. These names are changeable depending on data in
the sheet.

For example dataseries 1 name is cell A10. If cell A10 says "Jones"
then the dataseries is called Jones and if it says "Smith" then the
dataseries is called Smith.

My code is currently says this;

ActiveChart.seriescollection("SMITH").Select
With Selection.Border
.LineStyle = xlAutomatic
End With
With Selection
.MarkerStyle = xlNone
End With
End If

This works if the series is still called Smith (if cell A10 contents
are Smith). However if the series name changes to "Jones" (cell A10
contents changes to Jones) then my code doesn't work as it is referring
to a series that is no longer called Smith. How can I overcome this?
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Referring to data series in a chart

Fill in the real sheet name in place of Sheet1 in the first line:

With ActiveChart.SeriesCollection(Worksheets("Sheet1"). Range("A10").Value)
With .Border
.LineStyle = xlAutomatic
End With
.MarkerStyle = xlNone
End With

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


"keri" wrote in message
ups.com...
Hi,

I currently have a chart with dataseries that are named "Smith",
"Jones" "Brown" etc. These names are changeable depending on data in
the sheet.

For example dataseries 1 name is cell A10. If cell A10 says "Jones"
then the dataseries is called Jones and if it says "Smith" then the
dataseries is called Smith.

My code is currently says this;

ActiveChart.seriescollection("SMITH").Select
With Selection.Border
.LineStyle = xlAutomatic
End With
With Selection
.MarkerStyle = xlNone
End With
End If

This works if the series is still called Smith (if cell A10 contents
are Smith). However if the series name changes to "Jones" (cell A10
contents changes to Jones) then my code doesn't work as it is referring
to a series that is no longer called Smith. How can I overcome this?
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
Not plot a data series in a chart but still display in data table mebp Charts and Charting in Excel 1 March 19th 10 05:13 PM
chart with two data series and two colors for each data series bikash Charts and Charting in Excel 0 January 17th 08 02:04 AM
chart series data corrupted when chart has no data timp Excel Programming 0 April 11th 06 11:23 PM
automatically expand chart data series as data is added jlarson Charts and Charting in Excel 1 March 9th 06 10:31 AM
chart data series -- plot a table as a single series hjc Charts and Charting in Excel 7 September 20th 05 05:52 PM


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