Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Colouring error bars in a chart

Hi, I have draw a chart which has three series on it. I want to colour the
error based on the series they belong to. When I record the process I get:

ActiveSheet.ChartObjects("Chart 278").Activate
ActiveChart.SeriesCollection(1).ErrorBars.Select
With Selection.Border
.LineStyle = xlContinuous
.ColorIndex = 3
.Weight = xlThin
End With
Selection.EndStyle = xlNoCap

So I have tried to work this into something which might work:

With chtChart
.SeriesCollection(1).ErrorBars.Select
With Selection.Border
.LineStyle = xlContinuous
.ColorIndex = 3
.Weight = xlThin
End With
End With

But this is giving me an error. Can anyone see what is wrong?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Colouring error bars in a chart

Graham,

This should work: you need to work with the chartobject's chart, a step that isn't recorded by the
macro recorder.

With chtChart.Chart
With .SeriesCollection(1).ErrorBars
With .Border
.LineStyle = xlContinuous
.ColorIndex = 3
.Weight = xlThin
End With
End With
End With

HTH,
Bernie
MS Excel MVP


"Graham Whitehead" wrote in message
...
Hi, I have draw a chart which has three series on it. I want to colour the error based on the
series they belong to. When I record the process I get:

ActiveSheet.ChartObjects("Chart 278").Activate
ActiveChart.SeriesCollection(1).ErrorBars.Select
With Selection.Border
.LineStyle = xlContinuous
.ColorIndex = 3
.Weight = xlThin
End With
Selection.EndStyle = xlNoCap

So I have tried to work this into something which might work:

With chtChart
.SeriesCollection(1).ErrorBars.Select
With Selection.Border
.LineStyle = xlContinuous
.ColorIndex = 3
.Weight = xlThin
End With
End With

But this is giving me an error. Can anyone see what is wrong?




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
how to add error bars into bar chart John Smith[_8_] Charts and Charting in Excel 0 December 6th 11 07:35 PM
Customise error bars on individual bars in a bar chart 2007 Millie Charts and Charting in Excel 2 April 25th 09 04:16 AM
How to add error bars to 3-D chart Shijia Excel Discussion (Misc queries) 2 November 20th 07 09:48 PM
Trendline for chart with error bars Amy Charts and Charting in Excel 2 August 28th 07 02:48 AM
colouring in bars on a chart to correspond to quartiles Graham Whitehead Excel Programming 1 July 28th 06 03:27 AM


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